diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-26 23:52:26 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-26 23:52:26 -0500 |
commit | 360e56ec622617a2b121c7ec51e3381ad89f0eab (patch) | |
tree | e74250415c5e21080779befbb7898bd151039d63 /pcr/puppet/puppetmaster | |
parent | 34b4025bc7b0c6d8d47988decd140df38b1d98ac (diff) | |
parent | b1c14cd929ca53e06945a5cda3965dc6fcd9d6b7 (diff) | |
download | abslibre-360e56ec622617a2b121c7ec51e3381ad89f0eab.tar.gz abslibre-360e56ec622617a2b121c7ec51e3381ad89f0eab.tar.bz2 abslibre-360e56ec622617a2b121c7ec51e3381ad89f0eab.zip |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'pcr/puppet/puppetmaster')
-rwxr-xr-x | pcr/puppet/puppetmaster | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/pcr/puppet/puppetmaster b/pcr/puppet/puppetmaster new file mode 100755 index 000000000..8b3971053 --- /dev/null +++ b/pcr/puppet/puppetmaster @@ -0,0 +1,45 @@ +#!/bin/bash +DAEMON=$(type -p puppetmasterd) + +. /etc/rc.conf +. /etc/rc.d/functions +[ -f /etc/conf.d/puppetmaster ] && . /etc/conf.d/puppetmaster + +PID=$(pidof -xo %PPID $DAEMON) +case "$1" in + start) + stat_busy "Starting Puppet Master Daemon" + if [ -z "$PID" ]; then + [ -f /var/run/puppetmaster.pid ] && rm -f /var/run/puppetmaster.pid + $DAEMON $PUPPETMASTER_ARGS + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + PID=$(pidof -xo %PPID $DAEMON) + echo $PID > /var/run/puppetmaster.pid + add_daemon puppetmaster + stat_done + fi + ;; + stop) + stat_busy "Stopping Puppet Master Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon puppetmaster + rm -f /var/run/puppetmaster.pid + stat_done + fi + ;; + restart) + $0 stop + if [ ! -z $PID ]; then + while ps -p $PID > /dev/null; do sleep 1; done + fi + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac |