Frederiko Costa
2011-Aug-26 18:26 UTC
[Puppet Users] Service resource does disable services on reboots
Hi folks, The question I have is regarding to Service resource on Red Hat systems. I have the following example: service { [ "anacron", "atd" ]: ensure => stopped, enable => false, hasrestart => true, hasstatus => true, } It runs fine, disabling the service while the system is up. Debugging it, I noticed that it run the following: debug: Service[atd](provider=redhat): Executing ''/sbin/service atd status'' debug: Puppet::Type::Service:: ProviderRedhat: Executing ''/sbin/chkconfig atd'' The idea is to disable it completely, so it does not come back in the next reboot. By running ''/sbin/chkconfig atd'', that does not happen. So, the correct command, I think, would be ''/sbin/chkconfig atd off''. Is there any way to accomplish this? thanks, -fred -- 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
2011-Aug-29 14:27 UTC
[Puppet Users] Re: Service resource does disable services on reboots
On Aug 26, 1:26 pm, Frederiko Costa <freder...@gmail.com> wrote:> Hi folks, > > The question I have is regarding to Service resource on Red Hat systems. I > have the following example: > > service { [ "anacron", "atd" ]: > ensure => stopped, > enable => false, > hasrestart => true, > hasstatus => true, > } > > It runs fine, disabling the service while the system is up. Debugging it, I > noticed that it run the following: > debug: Service[atd](provider=redhat): Executing ''/sbin/service atd status'' > debug: Puppet::Type::Service:: > ProviderRedhat: Executing ''/sbin/chkconfig atd'' > > The idea is to disable it completely, so it does not come back in the next > reboot. By running ''/sbin/chkconfig atd'', that does not happen. So, the > correct command, I think, would be ''/sbin/chkconfig atd off''. > > Is there any way to accomplish this?Are you sure it''s broken? I strongly suspect that the Puppet agent runs "/sbin/chkconfig atd" as part of determining the current state of Service[''atd''], not in an attempt to modify that state. In particular, it is determining whether the service is currently enabled. If the resource is already in the desired state then Puppet will not modify it (so you will not see ''/sbin/chkconfig atd off'' in that case). John -- 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.