summaryrefslogtreecommitdiff
path: root/pcr/puppet/puppet
diff options
context:
space:
mode:
authoraurelien <tek@localhost.localdomain>2012-11-22 18:56:54 +0100
committeraurelien <tek@localhost.localdomain>2012-11-22 18:56:54 +0100
commit8298bee7828000bf1ab55304695872472883ab65 (patch)
treedeb47595e25e8acddff6fce94a403c918e6d909f /pcr/puppet/puppet
parentf97ff910471fb3ae2c8ea69befecaae8cbf6dbea (diff)
+ facter puppet ruby-hiera-json ruby-hiera ruby-shadow
Diffstat (limited to 'pcr/puppet/puppet')
-rwxr-xr-xpcr/puppet/puppet45
1 files changed, 45 insertions, 0 deletions
diff --git a/pcr/puppet/puppet b/pcr/puppet/puppet
new file mode 100755
index 000000000..4126be850
--- /dev/null
+++ b/pcr/puppet/puppet
@@ -0,0 +1,45 @@
+#!/bin/bash
+DAEMON=$(type -p puppetd)
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+[ -f /etc/conf.d/puppet ] && . /etc/conf.d/puppet
+
+PID=$(pidof -xo %PPID $DAEMON)
+case "$1" in
+ start)
+ stat_busy "Starting Puppet Daemon"
+ if [ -z "$PID" ]; then
+ [ -f /var/run/puppet.pid ] && rm -f /var/run/puppet.pid
+ $DAEMON $PUPPETD_ARGS
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=$(pidof -xo %PPID $DAEMON)
+ echo $PID > /var/run/puppet.pid
+ add_daemon puppet
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Puppet Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon puppet
+ rm -f /var/run/puppet.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