what should the service{...: ....., status=> <command>, ...... } return ? 0 => not running ?? be a good idea to add this to http://docs.puppetlabs.com/guides/types/service.html Russell -- 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.
On Wed, Dec 8, 2010 at 09:03, russell.fulton <russell.fulton@gmail.com> wrote:> what should the service{...: ....., status=> <command>, ...... } > return ? > 0 => not running ??The LSB result codes, ideally: http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html (but 0 => running, !0 => not running should be fine.)> be a good idea to add this to http://docs.puppetlabs.com/guides/types/service.htmlThat would probably be a good idea, indeed. A ticket is the most reliable way to record that, if you don''t mind. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
I now have my service status command that does a kill -0 on all the pid and return 1 if all the processes are running. I have this class/ service definition: class snort($master) { service{ "snort.$master": start => "sudo -u snort /home/snort/bin/restart-snort $master" , restart => "sudo -u snort /home/snort/bin/restart-snort $master" , stop => "sudo -u snort /home/snort/bin/restart-snort -stop $master", status => "sudo -u snort /home/snort/bin/restart-snort - status $master", ensure => running, subscribe => [ File[ "/home/snort/conf/$master/snort.conf", "/ home/snort/conf/$master/barnyard.conf"]], } } but puppet always decides that the process is not running and tries to start it. notice: /Stage[post]/Monitor::Snort/Service[snort.dmzi]/ensure: ensure changed ''stopped'' to ''running'' Is there any way I can get more diagnostics than that returned by -- test? -- 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.
On Dec 14, 3:15 am, "russell.fulton" <russell.ful...@gmail.com> wrote:> I now have my service status command that does a kill -0 on all the > pid and return 1 if all the processes are running. I have this class/ > service definition:Russell, That might be a typo in what you''ve written above but your script should be returning zero if everything is all right, not 1. 1 would indicate a problem and thus Puppet is trying to restart your service.> class snort($master) { > service{ > "snort.$master": > start => "sudo -u snort /home/snort/bin/restart-snort > $master" , > restart => "sudo -u snort /home/snort/bin/restart-snort > $master" , > stop => "sudo -u snort /home/snort/bin/restart-snort -stop > $master", > status => "sudo -u snort /home/snort/bin/restart-snort - > status $master", > ensure => running, > subscribe => [ File[ "/home/snort/conf/$master/snort.conf", "/ > home/snort/conf/$master/barnyard.conf"]], > } > } > > but puppet always decides that the process is not running and tries to > start it. > > notice: /Stage[post]/Monitor::Snort/Service[snort.dmzi]/ensure: ensure > changed ''stopped'' to ''running'' > > Is there any way I can get more diagnostics than that returned by -- > test?-- 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.
> > That might be a typo in what you''ve written above but your script > should be returning zero if everything is all right, not 1. 1 would > indicate a problem and thus Puppet is trying to restart yourservice. >Doh! -- no typo - that''s the problem. I even have the docs that say it should be zero. Thanks Luke.! -- 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.