Sha256: c2d16cc32c47282eb63cf992d2040ecdf78e6f2fc961b991518d32f8a9fe48a4

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

#!/bin/bash
# puppetmaster  This shell script enables the puppetmaster server.
#
# Author:       Duane Griffin <d.griffin@psenterprise.com>
#
# chkconfig: - 65 45
#
# description: Server for the puppet system management tool.
# processname: puppetmaster

PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

lockfile=/var/lock/subsys/puppetmaster

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/puppetmaster ]; then
	. /etc/sysconfig/puppetmaster
fi

[ -z "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp
[ -z "$PUPPETMASTER_LOG" ] && PUPPETMASTER_LOG="/var/log/puppet/puppetmaster.log"
PUPPETMASTER_OPTS="
	--manifest=$PUPPETMASTER_MANIFEST \
	--logdest=${PUPPETMASTER_LOG} \
	${PUPPETMASTER_EXTRA_OPTS}"

RETVAL=0

prog=puppetmasterd
PUPPETMASTER=/usr/sbin/$prog

start() {
	echo -n $"Starting puppetmaster: "

	# Confirm the manifest exists
	if [ -r $PUPPETMASTER_MANIFEST ]; then
		daemon $PUPPETMASTER $PUPPETMASTER_OPTS
		RETVAL=$?
	else
		failure $"Manifest does not exist: $PUPPETMASTER_MANIFEST"
		echo
		return 1
	fi
	[ $RETVAL -eq 0 ] && touch "$lockfile"
	echo
	return $RETVAL
}

stop() {
	echo -n  $"Stopping puppetmaster: "
	killproc $PUPPETMASTER
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f "$lockfile"
	return $RETVAL
}

restart() {
	echo -n $"Restarting puppet: "
        killproc $PUPPETMASTER -HUP
	RETVAL=$?
	echo
	return $RETVAL
}

case "$1" in
  start)
	start
	;;
  stop) 
	stop
	;;
  restart|reload|force-reload)
	restart
	;;
  condrestart)
	[ -f "$lockfile" ] && restart
	;;
  status)
	status $PUPPETMASTER
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
	exit 1
esac

exit $RETVAL

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppet-0.18.4 conf/redhat/server.init