Dear all, How can i restart "a" service on the agent [only] if the associated configuration file is changed. e.g. if I change the configuration in ntp.conf, I like to restart the ntpd as soon as the changes are detected and applied. Is there a way of doing that? Cheers!! -- 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.
You need to add a ''subscribe'' or ''notify'' parameter to your server or file resource (respectively). For example: http://docs.puppetlabs.com/references/stable/metaparameter.html#notify There is an example in the puppetlabs-ntp module: https://github.com/puppetlabs/puppetlabs-ntp/blob/master/manifests/init.pp#L94-109 Or you can just grab the ntp module from the forge and use that instead: http://forge.puppetlabs.com/puppetlabs/ntp ken. On Wed, Aug 10, 2011 at 12:51 PM, Sans <r.santanu.das@gmail.com> wrote:> Dear all, > > How can i restart "a" service on the agent [only] if the associated > configuration file is changed. e.g. if I change the configuration in > ntp.conf, I like to restart the ntpd as soon as the changes are > detected and applied. Is there a way of doing that? Cheers!! > > -- > 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. > >-- "Join us for PuppetConf, September 22nd and 23rd in Portland, OR: http://bit.ly/puppetconfsig" -- 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.
lists@truthisfreedom.org.uk
2011-Aug-10 12:40 UTC
Re: [Puppet Users] restarting a specific service
Quoting Sans <r.santanu.das@gmail.com>:> Dear all, > > How can i restart "a" service on the agent [only] if the associated > configuration file is changed. e.g. if I change the configuration in > ntp.conf, I like to restart the ntpd as soon as the changes are > detected and applied. Is there a way of doing that? Cheers!!check out "subscribe => File[''configurationfilename'']" in your service stanza or "notify => Service[''servicename'']" in your file stanza, either will work. check the docs for more information. M. -- 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.
Thanks to all for replying; going through the docs. cheers!! -- 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.