Sha256: 09363ada554277c6d5aad0d8d6f370e0c84ff9fab4593e8fe57aa814a8d2b761

Contents?: true

Size: 1.6 KB

Versions: 6

Compression:

Stored size: 1.6 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

PUPPETMASTER_OPTS=""
[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest=${PUPPETMASTER_LOG}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
	${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() {
  stop
  start
}

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

exit $RETVAL

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.23.2 conf/redhat/server.init
puppet-0.24.0 conf/redhat/server.init
puppet-0.24.2 conf/redhat/server.init
puppet-0.24.4 conf/redhat/server.init
puppet-0.24.1 conf/redhat/server.init
puppet-0.24.3 conf/redhat/server.init