Issue starting init.d script from puppet

asked 2014-11-19 09:31:15 -0600

jduren gravatar image

So, struggling with a fairly major problem, i've tried multiple different workarounds to try and get this working but there is something happening between puppet and the actual server that is just boggling my mind.

Basically, I have an init.d script /etc/init.d/rserve which is copied over correctly and when used from the command-line on the server works perfectly (i.e. sudo service rserve start|stop|status), the service returns correct error codes based on testing using echo $? on the different commands.

The puppet service statement is as follows:

service { 'rserve': ensure => running, enable => true, require => [File["/etc/init.d/rserve"], Package['r-base'], Exec['install-r-packages']] }

When puppet hits this service, it runs it's status method, sees that it isn't running and sets it to running and presumably starts the service, the output from puppet is below:

==> twine: debug: /Schedule[weekly]: Skipping device resources because running on a host ==> twine: debug: /Schedule[puppet]: Skipping device resources because running on a host ==> twine: debug: Service[rserve](provider=upstart): Could not find rserve.conf in /etc/init ==> twine: debug: Service[rserve](provider=upstart): Could not find rserve.conf in /etc/init.d ==> twine: debug: Service[rserve](provider=upstart): Could not find rserve in /etc/init ==> twine: debug: Service[rserve](provider=upstart): Executing '/etc/init.d/rserve status' ==> twine: debug: Service[rserve](provider=upstart): Executing '/etc/init.d/rserve start' ==> twine: notice: /Stage[main]/Etl/Service[rserve]/ensure: ensure changed 'stopped' to 'running'

Now when I actually check for the service using sudo service rserve status or ps aux | grep Rserve the service is in fact NOT running and a quick sudo service rserve start shows the init.d script is working fine and starting rserve as the service starts and is visible with ps aux.

Is there something I'm missing here? I've even tried starting the service by creating a puppet Exec { "sudo service rserve start"} which still reports that it executed successfully but the service is still not running on the server.

tl;dr puppet says a service started when it hasn't and there's seemingly nothing wrong with the init.d script.

edit retag flag offensive close merge delete