diff --git a/conf/redhat/client.init b/conf/redhat/client.init index 0c98383d5..04e0d27f2 100644 --- a/conf/redhat/client.init +++ b/conf/redhat/client.init @@ -1,116 +1,116 @@ #!/bin/bash # puppet Init script for running the puppet client daemon # # Author: Duane Griffin # David Lutterkort # # chkconfig: - 98 02 # # description: Enables periodic system configuration checks through puppet. # processname: puppet # config: /etc/sysconfig/puppet PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH [ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet lockfile=${LOCKFILE-/var/lock/subsys/puppet} -pidfile=${PIDFILE-/var/run/puppet/puppetd.pid} +pidfile=${PIDFILE-/var/run/puppet/agent.pid} puppetd=${PUPPETD-/usr/sbin/puppetd} RETVAL=0 # Source function library. . /etc/rc.d/init.d/functions PUPPET_OPTS="" [ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="--server=${PUPPET_SERVER}" [ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}" [ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --masterport=${PUPPET_PORT}" # Determine if we can use the -p option to killproc. RHEL < 5 can't. killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile" # Figure out if the system just booted. Let's assume # boot doesn't take longer than 5 minutes ## Not used for now ##[ -n "$INIT_VERSION" ] && PUPPET_OPTS="${PUPPET_OPTS} --fullrun" start() { echo -n $"Starting puppet: " daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} RETVAL=$? echo [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL } stop() { echo -n $"Stopping puppet: " killproc $killopts $puppetd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } reload() { echo -n $"Restarting puppet: " killproc $killopts $puppetd -HUP RETVAL=$? echo return $RETVAL } restart() { stop start } rh_status() { status | grep -q -- '-p' 2>/dev/null && statusopts="-p $pidfile" status $statusopts $puppetd RETVAL=$? return $RETVAL } rh_status_q() { rh_status >/dev/null 2>&1 } genconfig() { echo -n $"Generate configuration puppet: " $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} --genconfig } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload|force-reload) reload ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; status) rh_status ;; once) shift $puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} $@ ;; genconfig) genconfig ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once|genconfig}" exit 1 esac exit $RETVAL diff --git a/conf/redhat/puppet.conf b/conf/redhat/puppet.conf index d35593f12..47501a388 100644 --- a/conf/redhat/puppet.conf +++ b/conf/redhat/puppet.conf @@ -1,25 +1,25 @@ [main] # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl -[puppetd] +[agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt # Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig diff --git a/conf/redhat/server.init b/conf/redhat/server.init index 4f4420683..3d2897d27 100644 --- a/conf/redhat/server.init +++ b/conf/redhat/server.init @@ -1,137 +1,137 @@ #!/bin/bash # puppetmaster This shell script enables the puppetmaster server. # # Authors: Duane Griffin # Peter Meier (Mongrel enhancements) # # 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 -pidfile=/var/run/puppet/puppetmasterd.pid +pidfile=/var/run/puppet/master.pid # 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}" if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel" elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}" fi [ -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 if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}" daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid ret=$?; [ $ret != 0 ] && RETVAL=$ret done else daemon $PUPPETMASTER $PUPPETMASTER_OPTS RETVAL=$? fi 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: " if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}" killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster ret=$?; [ $ret != 0 ] && RETVAL=$ret done else killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile" killproc $killopts $PUPPETMASTER RETVAL=$? fi echo [ $RETVAL -eq 0 ] && rm -f "$lockfile" return $RETVAL } restart() { stop start } genconfig() { echo -n $"Generate configuration puppetmaster: " $PUPPETMASTER $PUPPETMASTER_OPTS --genconfig } rh_status() { if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do echo -en "Port ${PUPPETMASTER_PORTS[$i]}: " status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster ret=$?; [ $ret != 0 ] && RETVAL=$ret done else status $PUPPETMASTER RETVAL=$? fi return $RETVAL } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) start ;; stop) stop ;; restart|reload|force-reload) restart ;; condrestart) rh_status_q || exit 0 restart ;; status) rh_status ;; genconfig) genconfig ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}" exit 1 esac exit $RETVAL