I have this recipe setup to maintain puppetd: service { "puppet": name => $operatingsystem ? { Fedora => "puppet", CentOS => "puppet", Solaris => $kernelrelease ? { "5.10" => "svc:/network/puppetd:default", default => puppetd, }, default => "puppetd", }, ensure => running, enable => true, hasstatus => true, require => [ File["puppet.conf"], Service[network] ], subscribe => File["puppet.conf"], } If I shut down puppetd on a host (using a Fedora Core 9 host for testing, but has the same problem on Solaris, CentOS and FreeBSD, when I run ''puppetd --test'', it does not notice to restart puppet. Running ''service puppet status'' reports: puppetd is stopped I can add a ''pattern'' parameter, but I though since hasstatus is set, that ''service puppet status'' should be called instead of doing ''ps - ef|grep puppet''? I am running puppet 0.24.8 and facter 1.5.4 Ideas? - JimP --- @(#) $Id: dot.signature,v 1.15 2007/12/27 15:06:13 pirzyk Exp $ __o jim@pirzyk.org ------------------------------------------- _''\<,_ (*)/ (*) I''d rather be out biking.
It''s because ''service puppetd status'' reports that puppetd is running while puppetd is running in test mode. Trevor On Mon, Apr 6, 2009 at 10:40, Jim Pirzyk <pirzyk@freebsd.org> wrote:> I have this recipe setup to maintain puppetd: > > service { "puppet": > name => $operatingsystem ? { > Fedora => "puppet", > CentOS => "puppet", > Solaris => $kernelrelease ? { > "5.10" => "svc:/network/puppetd:default", > default => puppetd, > }, > default => "puppetd", > }, > ensure => running, > enable => true, > hasstatus => true, > require => [ File["puppet.conf"], Service[network] ], > subscribe => File["puppet.conf"], > } > > If I shut down puppetd on a host (using a Fedora Core 9 host for testing, > but has the same problem on Solaris, CentOS and FreeBSD, when I run ''puppetd > --test'', it does not notice to restart puppet. > Running ''service puppet status'' reports: > > puppetd is stopped > > I can add a ''pattern'' parameter, but I though since hasstatus is set, that > ''service puppet status'' should be called instead of doing ''ps -ef|grep > puppet''? > > I am running puppet 0.24.8 and facter 1.5.4 > > Ideas? > > - JimP > > --- @(#) $Id: dot.signature,v 1.15 2007/12/27 15:06:13 pirzyk Exp $ > __o jim@pirzyk.org ------------------------------------------- > _''\<,_ > (*)/ (*) I''d rather be out biking. > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 4/6/2009 9:40 AM, Jim Pirzyk wrote:> I have this recipe setup to maintain puppetd:> If I shut down puppetd on a host (using a Fedora Core 9 host for > testing, but has the same problem on Solaris, CentOS and FreeBSD, when I > run ''puppetd --test'', it does not notice to restart puppet.I''d normally expect that to work, but I just have puppet keep cron running, and have a periodic cron job that checks if puppet has died, and if so, restarts it: http://reductivelabs.com/trac/puppet/wiki/Recipes/MutualRestart Adjust cron commands to your needs. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mon, Apr 6, 2009 at 12:46 PM, Trevor Vaughan <peiriannydd@gmail.com>wrote:> > It''s because ''service puppetd status'' reports that puppetd is running > while puppetd is running in test mode. > > TrevorI had to replace the puppet init script to fix the status problem. I have it as a recipe to automatically replace so that it can maintain itself properly. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 6, 2009, at 12:46 PM, Trevor Vaughan wrote:> > It''s because ''service puppetd status'' reports that puppetd is running > while puppetd is running in test mode. > > TrevorI did just discover this as well. It is a bug in the /etc/rc.d/ init.d/functions file. They define the status function as: status() { local base pid pid_file # Test syntax. if [ "$#" = 0 ] ; then echo $"Usage: status [-p pidfile] {program}" return 1 fi if [ "$1" = "-p" ]; then pid_file=$2 shift 2 fi base=${1##*/} # First try "pidof" pid="$(__pids_pidof "$1")" if [ -n "$pid" ]; then echo $"${base} (pid $pid) is running..." return 0 fi # Next try "/var/run/*.pid" files __pids_var_run "$1" "$pid_file" case "$?" in 0) echo $"${base} (pid $pid) is running..." return 0 ;; 1) echo $"${base} dead but pid file exists" return 1 ;; esac # See if /var/lock/subsys/${base} exists if [ -f /var/lock/subsys/${base} ]; then echo $"${base} dead but subsys locked" return 2 fi echo $"${base} is stopped" return 3 } So even though you provide a PID file, the status command looks first in the process table (finding the puppetd --test) first. I have worked around this with the ''status'' parameter. status => "kill -0 `cat /var/run/puppet/puppetd.pid`", - JimP> On Mon, Apr 6, 2009 at 10:40, Jim Pirzyk <pirzyk@freebsd.org> wrote: >> I have this recipe setup to maintain puppetd: >> >> service { "puppet": >> name => $operatingsystem ? { >> Fedora => "puppet", >> CentOS => "puppet", >> Solaris => $kernelrelease ? { >> "5.10" => "svc:/network/puppetd:default", >> default => puppetd, >> }, >> default => "puppetd", >> }, >> ensure => running, >> enable => true, >> hasstatus => true, >> require => [ File["puppet.conf"], Service[network] ], >> subscribe => File["puppet.conf"], >> } >> >> If I shut down puppetd on a host (using a Fedora Core 9 host for >> testing, >> but has the same problem on Solaris, CentOS and FreeBSD, when I >> run ''puppetd >> --test'', it does not notice to restart puppet. >> Running ''service puppet status'' reports: >> >> puppetd is stopped >> >> I can add a ''pattern'' parameter, but I though since hasstatus is >> set, that >> ''service puppet status'' should be called instead of doing ''ps -ef| >> grep >> puppet''? >> >> I am running puppet 0.24.8 and facter 1.5.4 >> >> Ideas? >> >> - JimP >> >> --- @(#) $Id: dot.signature,v 1.15 2007/12/27 15:06:13 pirzyk Exp $ >> __o jim@pirzyk.org ------------------------------------------- >> _''\<,_ >> (*)/ (*) I''d rather be out biking. >> >> > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >--- @(#) $Id: dot.signature,v 1.15 2007/12/27 15:06:13 pirzyk Exp $ __o jim@pirzyk.org ------------------------------------------- _''\<,_ (*)/ (*) I''d rather be out biking.