diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-08-03 20:38:15 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-08-03 20:38:15 -0300 |
commit | ce20e84942a62970bede1671e8ea94f180f50319 (patch) | |
tree | f4012e4e2e49d589f0b853b4ee0264f6496d1df6 /social/puppet/puppetmaster | |
parent | fdcdd76fbbd6f12a4e0efe62d98ba33669ceb493 (diff) | |
download | abslibre-ce20e84942a62970bede1671e8ea94f180f50319.tar.gz abslibre-ce20e84942a62970bede1671e8ea94f180f50319.tar.bz2 abslibre-ce20e84942a62970bede1671e8ea94f180f50319.zip |
social/puppet-2.7.1-1
and dependencies
Diffstat (limited to 'social/puppet/puppetmaster')
-rwxr-xr-x | social/puppet/puppetmaster | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/social/puppet/puppetmaster b/social/puppet/puppetmaster new file mode 100755 index 000000000..8b3971053 --- /dev/null +++ b/social/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 |