updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / puppet / puppetmaster
blob8b39710530a6ebf1eb7c1fe89fd7e0571314e94f
1 #!/bin/bash
2 DAEMON=$(type -p puppetmasterd)
4 . /etc/rc.conf
5 . /etc/rc.d/functions
6 [ -f /etc/conf.d/puppetmaster ] && . /etc/conf.d/puppetmaster
8 PID=$(pidof -xo %PPID $DAEMON)
9 case "$1" in
10 start)
11 stat_busy "Starting Puppet Master Daemon"
12 if [ -z "$PID" ]; then
13 [ -f /var/run/puppetmaster.pid ] && rm -f /var/run/puppetmaster.pid
14 $DAEMON $PUPPETMASTER_ARGS
16 if [ ! -z "$PID" -o $? -gt 0 ]; then
17 stat_fail
18 else
19 PID=$(pidof -xo %PPID $DAEMON)
20 echo $PID > /var/run/puppetmaster.pid
21 add_daemon puppetmaster
22 stat_done
25 stop)
26 stat_busy "Stopping Puppet Master Daemon"
27 [ ! -z "$PID" ] && kill $PID &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon puppetmaster
32 rm -f /var/run/puppetmaster.pid
33 stat_done
36 restart)
37 $0 stop
38 if [ ! -z $PID ]; then
39 while ps -p $PID > /dev/null; do sleep 1; done
41 $0 start
44 echo "usage: $0 {start|stop|restart}"
45 esac