Richard K. Miller
2012-Jan-30 23:05 UTC
[Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
I''m using Dropbox''s command-line daemon on one of our machines and want to use Puppet to keep it running. The dropbox service is already installed and allows me to successfully execute /etc/init.d/dropbox [start/stop/restart/service]. Here''s my code: class dropbox::service { service { "dropbox": ensure => running, } } I get the following syslog error when this runs: (/Stage[main]/Dropbox::Service/Service[dropbox]/ensure) change from stopped to running failed: Could not start Service[dropbox]: Execution of ''/etc/init.d/dropbox start'' returned 1: at /etc/puppet/modules/ dropbox/manifests/init.pp:14 However, if I run the above command manually, it works fine and returns 0: root@webhost:~# /etc/init.d/dropbox start ; echo $? Starting dropbox... 0 Any ideas why puppet can''t start the dropbox daemon? Richard -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nan Liu
2012-Jan-31 17:19 UTC
Re: [Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
On Mon, Jan 30, 2012 at 6:05 PM, Richard K. Miller <richardkmiller@gmail.com> wrote:> I''m using Dropbox''s command-line daemon on one of our machines and > want to use Puppet to keep it running. The dropbox service is already > installed and allows me to successfully execute /etc/init.d/dropbox > [start/stop/restart/service]. Here''s my code: > > class dropbox::service { > service { "dropbox": > ensure => running, > } > } > > I get the following syslog error when this runs: > (/Stage[main]/Dropbox::Service/Service[dropbox]/ensure) change from > stopped to running failed: Could not start Service[dropbox]: Execution > of ''/etc/init.d/dropbox start'' returned 1: at /etc/puppet/modules/ > dropbox/manifests/init.pp:14 > > However, if I run the above command manually, it works fine and > returns 0: > > root@webhost:~# /etc/init.d/dropbox start ; echo $? > Starting dropbox... > 0 > > Any ideas why puppet can''t start the dropbox daemon?Try this on the command line: puppet resource service dropbox ensure=running -d Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2012-Jan-31 17:19 UTC
Re: [Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
Hi, On 01/31/2012 12:05 AM, Richard K. Miller wrote:> I get the following syslog error when this runs: > (/Stage[main]/Dropbox::Service/Service[dropbox]/ensure) change from > stopped to running failed: Could not start Service[dropbox]: Execution > of ''/etc/init.d/dropbox start'' returned 1: at /etc/puppet/modules/ > dropbox/manifests/init.pp:14 > > However, if I run the above command manually, it works fine and > returns 0: > > root@webhost:~# /etc/init.d/dropbox start ; echo $? > Starting dropbox... > 0it''s a long shot, but there might be a problem related to the environment when puppet runs the initscript. Try the "start" command with a clean environment. Side question: When you''re trying that, is the service actually stopped? Is puppet deducing that much correctly? Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Aaron Grewell
2012-Jan-31 17:25 UTC
Re: [Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
> However, if I run the above command manually, it works fine and > returns 0: > > root@webhost:~# /etc/init.d/dropbox start ; echo $? > Starting dropbox... > 0 > > Any ideas why puppet can''t start the dropbox daemon?I had the same problem when running ssh-keygen via an exec. It ran fine from the CLI but not via Puppet. In my case it turned out that SELinux had been left enabled, so that''s one thing to check. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ryan Bowlby
2012-Jan-31 22:25 UTC
[Puppet Users] Re: Puppet can''t start service (dropbox) but init.d command works manually
I second checking for required environment variables. Attempt to run in a shell that hasn''t sourced your .bash_profile and related login- time config files. Also, try it with an exec with "/bin/bash -x /etc/ init.d/dropbox start" to further troubleshoot. On Jan 30, 3:05 pm, "Richard K. Miller" <richardkmil...@gmail.com> wrote:> I''m using Dropbox''s command-line daemon on one of our machines and > want to use Puppet to keep it running. The dropbox service is already > installed and allows me to successfully execute /etc/init.d/dropbox > [start/stop/restart/service]. Here''s my code: > > class dropbox::service { > service { "dropbox": > ensure => running, > } > > } > > I get the following syslog error when this runs: > (/Stage[main]/Dropbox::Service/Service[dropbox]/ensure) change from > stopped to running failed: Could not start Service[dropbox]: Execution > of ''/etc/init.d/dropbox start'' returned 1: at /etc/puppet/modules/ > dropbox/manifests/init.pp:14 > > However, if I run the above command manually, it works fine and > returns 0: > > root@webhost:~# /etc/init.d/dropbox start ; echo $? > Starting dropbox... > 0 > > Any ideas why puppet can''t start the dropbox daemon? > > Richard-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Richard K. Miller
2012-Feb-01 01:01 UTC
[Puppet Users] Re: Puppet can''t start service (dropbox) but init.d command works manually
Felix & Ryan: Good thought to try a clean environment. I tried "bash -- no-profile" and then ran the CLI command again, but it still worked. My perusal of the script itself didn''t seem to show any environment variable dependencies. Felix, yes, puppet is correctly deducing that the service is stopped, and it is indeed not running after puppet runs. Aaron: This is running on Ubuntu 11.04, so no SELinux, but AppArmor is on. Could that be a factor? Nan, here is the output from "puppet resource service dropbox ensure=running -d": debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/ svstat does not exist debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does not exist debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist debug: Loaded state in 0.00 seconds debug: Service[dropbox](provider=debian): Executing ''ps -ef'' debug: Service[dropbox](provider=debian): PID is 28233 debug: Finishing transaction 70128500285900 debug: Storing state debug: Stored state in 0.02 seconds debug: Service[dropbox](provider=debian): Executing ''ps -ef'' debug: Service[dropbox](provider=debian): PID is 28233 service { ''dropbox'': ensure => ''running'' } Thanks, everyone, for your responses. Richard On Jan 31, 3:25 pm, Ryan Bowlby <rbowlb...@gmail.com> wrote:> I second checking for required environment variables. Attempt to run > in a shell that hasn''t sourced your .bash_profile and related login- > time config files. Also, try it with an exec with "/bin/bash -x /etc/ > init.d/dropbox start" to further troubleshoot. > > On Jan 30, 3:05 pm, "Richard K. Miller" <richardkmil...@gmail.com> > wrote: > > > > > > > > > I''m using Dropbox''s command-line daemon on one of our machines and > > want to use Puppet to keep it running. The dropbox service is already > > installed and allows me to successfully execute /etc/init.d/dropbox > > [start/stop/restart/service]. Here''s my code: > > > class dropbox::service { > > service { "dropbox": > > ensure => running, > > } > > > } > > > I get the following syslog error when this runs: > > (/Stage[main]/Dropbox::Service/Service[dropbox]/ensure) change from > > stopped to running failed: Could not start Service[dropbox]: Execution > > of ''/etc/init.d/dropbox start'' returned 1: at /etc/puppet/modules/ > > dropbox/manifests/init.pp:14 > > > However, if I run the above command manually, it works fine and > > returns 0: > > > root@webhost:~# /etc/init.d/dropbox start ; echo $? > > Starting dropbox... > > 0 > > > Any ideas why puppet can''t start the dropbox daemon? > > > Richard-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2012-Feb-03 09:24 UTC
Re: [Puppet Users] Re: Puppet can''t start service (dropbox) but init.d command works manually
Hi, On 02/01/2012 02:01 AM, Richard K. Miller wrote:> AppArmor is > on. Could that be a factor?I certainly believe so. It should be investigated. Regards -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ashley Baumann
2012-Jul-02 04:10 UTC
Re: [Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
This was failing for me because the init.d script needed a #!/bin/sh at the top of it. Puppet was getting an "Exec Format Error" when it tried to run it. 11008 execve("/etc/init.d/dropbox", ["/etc/init.d/dropbox", "status"], [/* 23 vars */]) = -1 ENOEXEC (Exec format error) Ashleyb -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jon Jaroker
2013-Sep-14 21:48 UTC
Re: [Puppet Users] Puppet can''t start service (dropbox) but init.d command works manually
Ashley, Thanks for reporting the solution. I was just struggling with the same odd behavior. My setup automatically inserts "puppet managed" comments at the top of all templates, but this breaks init scripts (at least in Debian). Jon ============Jon Jaroker http://jaroker.com On Monday, July 2, 2012 12:10:29 AM UTC-4, Ashley Baumann wrote:> > This was failing for me because the init.d script needed a #!/bin/sh at > the top > of it. Puppet was getting an "Exec Format Error" when it tried to run it. > > > 11008 execve("/etc/init.d/dropbox", ["/etc/init.d/dropbox", "status"], [/* > 23 > vars */]) = -1 ENOEXEC (Exec format error) > > Ashleyb > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.