summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2009-10-25 11:00:42 -0400
committerTodd Zullinger <tmz@pobox.com>2009-10-25 12:13:02 -0400
commit9dff7167b71f392ec4706c5e220f52c9e1694d0a (patch)
treecb2a6e0fb10eb553a711ee648b34304930d1cef7 /conf
parentf47a70f46baa8b3c71c7e23471827a43abbbe598 (diff)
downloadpuppet-9dff7167b71f392ec4706c5e220f52c9e1694d0a.tar.gz
puppet-9dff7167b71f392ec4706c5e220f52c9e1694d0a.tar.xz
puppet-9dff7167b71f392ec4706c5e220f52c9e1694d0a.zip
conf/redhat/*.init: Use -p option to killproc
If a puppetd run was started manually and 'service puppet stop' was run the killproc function used would kill the manually started puppetd. On Fedora and newer RHEL (>= 5) we now use the -p option to prevent this. This fixes #2751 (Red Hat initscripts kill an independently started puppetd/puppetmasterd) Signed-off-by: Todd Zullinger <tmz@pobox.com>
Diffstat (limited to 'conf')
-rw-r--r--conf/redhat/client.init7
-rw-r--r--conf/redhat/server.init5
2 files changed, 8 insertions, 4 deletions
diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index a5ac08d87..0c98383d5 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -27,6 +27,9 @@ PUPPET_OPTS=""
[ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
[ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --masterport=${PUPPET_PORT}"
+# Determine if we can use the -p option to killproc. RHEL < 5 can't.
+killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
+
# Figure out if the system just booted. Let's assume
# boot doesn't take longer than 5 minutes
## Not used for now
@@ -43,7 +46,7 @@ start() {
stop() {
echo -n $"Stopping puppet: "
- killproc $puppetd
+ killproc $killopts $puppetd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
@@ -51,7 +54,7 @@ stop() {
reload() {
echo -n $"Restarting puppet: "
- killproc $puppetd -HUP
+ killproc $killopts $puppetd -HUP
RETVAL=$?
echo
return $RETVAL
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 4bc44b9fb..5505058ed 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -71,8 +71,9 @@ stop() {
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
- killproc $PUPPETMASTER
- RETVAL=$?
+ killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
+ killproc $killopts $PUPPETMASTER
+ RETVAL=$?
fi
echo
[ $RETVAL -eq 0 ] && rm -f "$lockfile"