Daniel Maher
2010-Aug-06 10:56 UTC
[Puppet Users] "ensure => running" an init script that isn''t actually a service ?
Hello all, Based on this post from July : http://www.mailinglistarchive.com/html/puppet-users@googlegroups.com/2010-07/msg00124.html The OP has this snippet running on an RHEL system : file { "network": ... notify => Service[network] } service { network: ensure => "running", hasstatus => "true", hasrestart => "true", restart => "/etc/init.d/network restart", } Clearly the idea is to trigger a network restart if the given file changes ; however, "network" isn''t really a service, it''s an init script, which means that it''s not generally "running". On a given CentOS machine, ralsh says : $ ralsh service network service { ''network'': enable => ''true'', ensure => ''running'' } Which is what we want, but i''m curious as to _why_ this is so, given (again) that we''re talking about an init script, and not a particular service that sits in memory. Granted, the effects of the script can be known - is puppet smart enough to figure out what effect "service network *" ultimately has on the system, or is this sort of a happy accident, or yet something else entirely ? Thank you. -- Daniel Maher <dma AT witbe DOT net> "The Internet is completely over." -- Prince -- 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.
Rob McBroom
2010-Aug-06 12:29 UTC
Re: [Puppet Users] "ensure => running" an init script that isn''t actually a service ?
On Aug 6, 2010, at 6:56 AM, Daniel Maher wrote:> Which is what we want, but i''m curious as to _why_ this is so, given (again) that we''re talking about an init script, and not a particular service that sits in memory. Granted, the effects of the script can be known - is puppet smart enough to figure out what effect "service network *" ultimately has on the system, or is this sort of a happy accident, or yet something else entirely ?This is just guessing from behavior I’ve witnessed, but I think Puppet calls `service whatever status` and looks at the exit status. 0 means “running” and everything else means not running. `service network status` exits with 0 on my RHEL5 systems. -- Rob McBroom <http://www.skurfer.com/> -- 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
2010-Aug-10 09:56 UTC
Re: [Puppet Users] "ensure => running" an init script that isn''t actually a service ?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>> Which is what we want, but i''m curious as to _why_ this is so, >> given (again) that we''re talking about an init script, and not a >> particular service that sits in memory. Granted, the effects of >> the script can be known - is puppet smart enough to figure out what >> effect "service network *" ultimately has on the system, or is this >> sort of a happy accident, or yet something else entirely ? > > This is just guessing from behavior I’ve witnessed, but I think > Puppet calls `service whatever status` and looks at the exit status. > 0 means “running” and everything else means not running. > > `service network status` exits with 0 on my RHEL5 systems.exactly. that''s the terminology (running) used for init.d scripts that exit with 0. cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxhImUACgkQbwltcAfKi39bMwCfWh4pUk3/QHuoIuQVXEqXt5o4 EOEAni3a90LZLeAOFIpcnvBHRB/vix6C =Gald -----END PGP SIGNATURE----- -- 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.