Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

service can't be run on CentOS #16

Closed
viktortnk opened this issue Aug 23, 2014 · 13 comments
Closed

service can't be run on CentOS #16

viktortnk opened this issue Aug 23, 2014 · 13 comments

Comments

@viktortnk
Copy link

Error: Could not start Service[mesos-slave]: Execution of '/sbin/service mesos-slave start' returned 1: mesos-slave: unrecognized service
Wrapped exception:

Execution of '/sbin/service mesos-slave start' returned 1: mesos-slave: unrecognized service
Error: /Stage[main]/Mesos::Slave/Mesos::Service[slave]/Service[mesos-slave]/ensure: change from stopped to running failed: Could not start Service[mesos-slave]: Execution of '/sbin/service mesos-slave start' returned 1: mesos-slave: unrecognized service

specifying provider => 'upstart' solves the issue

service { "mesos-${name}":
    ensure     => 'running',
    provider   => 'upstart',
    hasstatus  => true,
    hasrestart => true,
    enable     => $enable,
    subscribe  => [ File['/etc/default/mesos'],
      File["/etc/default/mesos-${name}"]
    ],
  }
@deric
Copy link
Owner

deric commented Aug 25, 2014

Which version of CentOS and Puppet do you have? Is it 6? Have a look here: #8

We can't simply use upstart provider for whole RedHat family. It gets more complicated, RHEL7 uses systemd. Managing services should be generally handled by Puppet, there is a bug related to this issue:
https://tickets.puppetlabs.com/browse/PUP-876
which should be fixed in Puppet 3.5.0

Rather than copying this logic from Puppet we've decided to keep the code as simple as possible, which should ensure compatibility with future releases of RedHat OS.

@viktortnk
Copy link
Author

Ok. Sorry, makes sense.

It is CentOS 6.5 and Puppet 3.6.2

@deric
Copy link
Owner

deric commented Aug 28, 2014

If you would insist on this we can add some parameter like force_provider to override Puppet configuration. Or is it possible to solve this by upgrading Puppet?

@viktortnk
Copy link
Author

Puppet 3.6.2 is fairly latest production version. And it doesn't work with it.

I would happy if we can introduce change to specify provider (force_provider).

@deric deric reopened this Aug 29, 2014
@deric
Copy link
Owner

deric commented Aug 29, 2014

Ok, sure if there's no other workaround we could add it. @wleese what do you think?

@wleese
Copy link
Contributor

wleese commented Aug 29, 2014

Strange. Has the service script properly been installed into init.d? More details would be great. It looks like init.d isnt used, so if that isnt happening, it d be good to know what puppet is doing.

@viktortnk
Copy link
Author

@wleese No, the script is placed into /etc/init/ directory, which is used by upstart

@wleese
Copy link
Contributor

wleese commented Aug 31, 2014

Ah! Of course. The real issue here is the rpm. It only has an upstart script and doesnt present anything useful for non upstart systems.
So the bug is with the rpm, not the puppet module. The override_provider param should provide a workaround until mesos finally starts including the sysvinit script like all redhat rpms.
Another alternative would be to have this module setup its own sysvinit, but that ll break once/if the rpm changes.

@deric
Copy link
Owner

deric commented Sep 1, 2014

Ok, if I understand it correctly we could fix this by changing mesos packaging: https://github.com/mesosphere/mesos-deb-packaging/blob/master/build_mesos#L204

    redhat/6|redhat/6.*|centos/6|centos/6.*)
      mkdir -p etc/init
      cp "$this"/ubuntu/master.upstart etc/init/mesos-master.conf
      cp "$this"/ubuntu/slave.upstart etc/init/mesos-slave.conf ;;

RedHat 6 is by default looking into /etc/init.d? And supports both init.d and upstart scripts? (I'm sorry I have zero experience with RedHat Linux).

@wleese
Copy link
Contributor

wleese commented Sep 2, 2014

Well, the github title says it deals with debian packaging, not redhat..
really weird. My guess is that they were lazy and changed their deb
packaging scripts to have hacky redhat support.

RedHat supports both upstart and sysvinit (init.d), but really only uses
init.d. So Puppet will only try to use sysvinit on redhat systems (unless
we provide the override_provider param).

Structural fix would require writing and testing a proper sysvinit script (
http://www.thegeekstuff.com/2012/03/lsbinit-script/) and then getting mesos
to use it. (pull request and a change to the lines you mentioned in your
comment to reference the sysvinit script, not the upstart cfg file).

Frankly, providing the override provider parameter is the best short term
solution.

On Mon, Sep 1, 2014 at 10:12 PM, deric notifications@github.com wrote:

Ok, if I understand it correctly we could fix this by changing mesos
packaging:
https://github.com/mesosphere/mesos-deb-packaging/blob/master/build_mesos#L204

redhat/6|redhat/6.*|centos/6|centos/6.*)
  mkdir -p etc/init
  cp "$this"/ubuntu/master.upstart etc/init/mesos-master.conf
  cp "$this"/ubuntu/slave.upstart etc/init/mesos-slave.conf ;;

RedHat 6 is by default looking into /etc/init.d? And supports both init.d
and upstart scripts? (I'm sorry I have zero experience with RedHat Linux).


Reply to this email directly or view it on GitHub
#16 (comment).

deric added a commit that referenced this issue Sep 2, 2014
@deric
Copy link
Owner

deric commented Sep 2, 2014

That repo is a fork of mine repository which was intended as Debian packing. Partially mine fault :)

I'll submit an issue to mesosphere repo, until then, you can use force_provider. For Fedora (it might work also on CentOS 7) there seems to be native packages: http://koji.fedoraproject.org/koji/packageinfo?packageID=17691 (hopefully better ones).

@tomstockton
Copy link
Contributor

It looks like there isn't an updated tag for this repo which includes the force_provider workaround.

Therefore I can't use this module from Puppetforge at the moment.

Any chance of creating an updated tag?

@deric
Copy link
Owner

deric commented Nov 28, 2014

Sure, I've tagged it as v0.5.0 and it's available at Puppetforge.

@deric deric closed this as completed in c294c17 Jan 28, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants