- CentOS release 5.4 (Final)
puppet-server-2.7.19-1.el5
is installed from the puppetlabs repo.
puppetmaster
is started successfull, but it doesn't create the pid file. It is the reason for [ FAILED ]
message when stopping:
/etc/init.d/puppetmaster stop
Stopping puppetmaster: [FAILED]
The init script: http://fpaste.org/nsfI/
The /etc/rc.d/init.d/functions
library: http://fpaste.org/ox5Q/
And this is what I get when running in the debug mode: http://fpaste.org/DkoS/
I know the way to echo
the pid to a file manually after starting, but why doesn't daemon
function's --pidfile
work?
daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
Sure, Puppet master is running as puppet
user:
ps -ef | grep [p]uppet
puppet 23418 1 0 18:13 ? 00:00:00 /usr/bin/ruby /usr/sbin/puppetmasterd
and the owner of /var/run/puppet/
folder is puppet
:
# ls -ld /var/run/puppet/
drwxr-xr-x 2 puppet puppet 4096 Sep 17 18:46 /var/run/puppet/
So, it looks to me like there could be a couple of possibilities here:
If you are trying to use the --pidfile option of the daemon command I believe you have a syntax problem.
Usage: daemon [+/-nicelevel] {program}
. What isn't altogether clear is that anything that you include after the program location is treated as an option passed to the program, not to the daemon function call.--pidfile
argument to$PUPPETMASTER
itself as opposed todaemon()
. You could remedy this by using the following:daemon --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]}
The second option here is that
$PUPPETMASTER
(or rather, the program behind it) might daemonize itself, and if so, could be responsible for creating its own .pid file. The process management tool Circus works in this way. It's probably an option in a configuration file or for the program representing by$PUPPETMASTER
.--pidfile
argument being passed todaemon()
will have no effect.Good hunting!