I''m trying to figure out how "ensure => running" determines whether a service is running or not (CentOS using init controlled services). I have a custom service that has enable => running set on it: service { "foo": ensure => running, enable => true } Every time puppet runs I see this: notice: //Service[foo]/ensure: ensure changed ''stopped'' to ''running'' and yet the binary is running, and my init.d script thinks it''s running: # /etc/init.d/foo status foo (pid 4487) is running... # echo $? 0 My guess is that I''m not doing something quite right in my init.d script as I have other custom services that are working just fine, but since I cloned this one from a working one, it''s baffling me. How does puppet check whether a service is running or not for an init service? Thanks, Pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nigel Kersten
2009-Jul-10 18:06 UTC
[Puppet Users] Re: Tracking down ensure => running problem
On Fri, Jul 10, 2009 at 11:00 AM, Pete Emerson<pemerson@gmail.com> wrote:> I''m trying to figure out how "ensure => running" determines whether a > service is running or not (CentOS using init controlled services). > > I have a custom service that has enable => running set on it: > > service { "foo": > ensure => running, > enable => true > } > > Every time puppet runs I see this: > > notice: //Service[foo]/ensure: ensure changed ''stopped'' to ''running'' > > and yet the binary is running, and my init.d script thinks it''s running: > > # /etc/init.d/foo status > foo (pid 4487) is running... > # echo $? > 0 > > My guess is that I''m not doing something quite right in my init.d script as > I have other custom services that are working just fine, but since I cloned > this one from a working one, it''s baffling me. How does puppet check whether > a service is running or not for an init service?Do you need to add a hasstatus parameter? Perhaps your other init scripts were working due to process table lookups? ------------------------------ http://reductivelabs.com/trac/puppet/wiki/TypeReference#service hasstatus Declare the the service''s init script has a functional status command. Based on testing, it was found that a large number of init scripts on different platforms do not support any kind of status command; thus, you must specify manually whether the service you are running has such a command (or you can specify a specific command using the status parameter). If you do not specify anything, then the service name will be looked for in the process table. Valid values are true, false. ------------------------------> > Thanks, > Pete > > > >-- Nigel Kersten nigelk@google.com System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter Meier
2009-Jul-10 18:09 UTC
[Puppet Users] Re: Tracking down ensure => running problem
Hi> My guess is that I''m not doing something quite right in my init.d script as > I have other custom services that are working just fine, but since I cloned > this one from a working one, it''s baffling me. How does puppet check whether > a service is running or not for an init service?as in earlier days you can''t be sure that every init script had a status option, init.d didn''t use it in earlier versions. Afair this have been changed in the latest version (0.24.8), at least there have been a discussion about that on the dev list. however you can enforce this behavior by setting hasstatus => true cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jcbollinger
2009-Jul-10 20:21 UTC
[Puppet Users] Re: Tracking down ensure => running problem
Peter Meier wrote:> as in earlier days you can''t be sure that every init script had a > status option, init.d didn''t use it in earlier versions. Afair this > have been changed in the latest version (0.24.8), at least there have > been a discussion about that on the dev list. > > however you can enforce this behavior by setting hasstatus => trueI haven''t checked all the CentOS 4 / 5 initscripts, but every one I *have* checked does support both the status option and the restart option. For that OS I routinely set both hasstatus => true and hasrestart => true, and so far it has worked well for me. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---