#!/bin/sh # puppetmaster This shell script enables the puppetmaster server. # # Author: Duane Griffin <d.griffin@psenterprise.com> # Martin Vuk <martin.vuk@fri.uni-lj.si> (SuSE support) # # chkconfig: - 65 45 # # description: Server for the puppet system management tool. # processname: puppetmaster # config: /etc/sysconfig/puppetmasterd ### BEGIN INIT INFO # Provides: puppetmaster # Required-Start: $local_fs $network $syslog # Should-Start: # Required-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: Starts the puppetmasterd daemon (for Puppet server) # Description: puppetmasterd is the server for the puppet system management tool. ### END INIT INFO # Local variables DAEMON_NAME=puppetmasterd DAEMON_PROCESS=$DAEMON_NAME DAEMON_BINARY=/usr/sbin/$DAEMON_PROCESS LOCKFILE=/var/lock/subsys/$DAEMON_PROCESS PIDFILE=/var/run/$DAEMON_PROCESS.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # load service configuration [ -f /etc/sysconfig/$DAEMON_NAME ] && . /etc/sysconfig/$DAEMON_NAME [ -z "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp [ -z "$PUPPETMASTER_LOG" ] && PUPPETMASTER_LOG="/var/log/puppet/puppetmaster.log" OPTIONS=" --manifest=$PUPPETMASTER_MANIFEST \ --logdest=$PUPPETMASTER_LOG \ $PUPPETMASTER_EXTRA_OPTS" start() { if [ ! -r $PUPPETMASTER_MANIFEST ]; then gprintf "Manifest file does not exist: $PUPPETMASTER_MANIFEST" failure "Manifest file does not exist: %s" "$PUPPETMASTER_MANIFEST" RETVAL=1 # Check if it is already running elif [ ! -f $LOCKFILE ]; then gprintf "Starting %s daemon: " "$DAEMON_NAME" daemon $DAEMON_BINARY $OPTIONS RETVAL=$? [ $RETVAL -eq 0 ] && touch $LOCKFILE fi echo return $RETVAL } stop() { gprintf "Stopping %s daemon: " "$DAEMON_NAME" killproc $DAEMON_PROCESS RETVAL=$? [ $RETVAL -eq 0 ] && rm -f $LOCKFILE echo return $RETVAL } restart() { stop start } # reload() { # gprintf "Reloading %s configuration\n" "$DAEMON_NAME" # killproc $DAEMON_PROCESS SIGHUP # RETVAL=$? # echo # } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condrestart|condreload) if [ -f $LOCKFILE ]; then restart fi ;; status) status $DAEMON_PROCESS RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|restart|reload|condrestart|condreload|status}\n" "$0" RETVAL=1 ;; esac exit $RETVAL