For my nagios::nrpe class, I have the following service: service {"nagios-nrpe-server": ensure => running, enable => true, require => Package["nagios-nrpe-server"], hasrestart => true, restart => "/etc/init.d/nagios-nrpe-server restart", subscribe => File["/etc/nagios/nrpe.d/"], } In all of the nrpe config file entries, I have: notify => Service["nagios-nrpe-server"] It even says that it restarted the service: info: /Stage[main]//Node[alpha.xxxxxxxx.net]/Nagios::Nrpe::Check_mem[alpha.xxxxxxxx.net]/Nagios::Nrpe::Check[mem]/File[/etc/nagios/nrpe.d/check_mem.cfg]: Scheduling refresh of Service[nagios-nrpe-server] notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]/ensure: ensure changed ''stopped'' to ''running'' notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]: Triggered ''refresh'' from 1 events However, it wont actually restart the service, and I have to do it manually: sudo /etc/init.d/nagios-nrpe-server restart After that, it works perfectly. I am running Puppet 2.6.2 on Debian Lenny -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/MqrRoS9Uz5cJ. 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.
Ken Barber
2011-Jul-08 00:07 UTC
Re: [Puppet Users] I have a service that just wont restart.
> notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]/ensure: ensure > changed ''stopped'' to ''running''That looks like its trying to start it, not restart it. Do you get this message each time you do a puppet run (even when nothing has changed)? If so - you might need a valid ''status'' command and use hasstatus => true. It probably thinks its not started perhaps. Puppet falls back to looking in the process table when you don''t specify hasstatus => true to determine service status - and it uses the name of the service (in this case nagios-nrpe-server) to do the search. ken. -- 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.
Joehillen
2011-Jul-08 00:18 UTC
Re: [Puppet Users] I have a service that just wont restart.
Yes, it says it every time. The actual process is called "nrpe", so that makes sense that it can''t find it. Unfortunately, it doesn''t have a status command. What should I do instead? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/3UvUuuLOprIJ. 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.
Ken Barber
2011-Jul-08 00:29 UTC
Re: [Puppet Users] I have a service that just wont restart.
Use the pattern attribute, documented here: http://docs.puppetlabs.com/references/stable/type.html#service ken. On Fri, Jul 8, 2011 at 1:18 AM, Joehillen <joehillen@gmail.com> wrote:> Yes, it says it every time. The actual process is called "nrpe", so that > makes sense that it can''t find it. > Unfortunately, it doesn''t have a status command. What should I do instead? > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/3UvUuuLOprIJ. > 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.
Joehillen
2011-Jul-08 00:37 UTC
Re: [Puppet Users] I have a service that just wont restart.
Awesome! Adding `pattern => "nrpe"` solved the issue. Thanks for your help. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/hcKGdrX7F4gJ. 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.