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. Trevor
I 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 <pir...@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 stoppedI can add a 'pattern' parameter, but I though since hasstatus is set, that 'service puppet status' should be called instead of doing 'ps -ef| greppuppet'? 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 j...@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.comTo unsubscribe from this group, send email to puppet-users +unsubscr...@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 j...@pirzyk.org ------------------------------------------- _'\<,_ (*)/ (*) I'd rather be out biking.
PGP.sig
Description: This is a digitally signed message part