Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
[root@dukesrvi01 httpd]# cat /etc/init.d/puppetmaster #!/bin/bash #Puppet master using Mongrel init script for use on RedHat systems. # This script controls all of the process which comprise the Puppet master. # Specifically, an Apache httpd front end configured to reverse proxy to # several Puppetmasters using Mongrel. # chkconfig: - 65 45 export PATH=/usr/bin:/sbin:/bin:/usr/sbin # Redhat functions . /etc/rc.d/init.d/functions RETVAL=0 # Run multiple puppetmasters on these ports PUPPETMASTERPORTS="8150 8151 8152 8153 8154" # Locking and run stuff RUNDIR=/var/lib/puppet/run LOCKDIR=/var/lock/subsys/ start() { local daemonargs=' --check $base --pidfile $pidfile' for pmp in $PUPPETMASTERPORTS ; do local pmargs="--servertype mongrel --masterport $pmp --pidfile \$pidfile" start_proc puppetmaster-$pmp $daemonargs puppetmasterd $pmargs done httpdargs="-f /etc/puppet/httpd.conf" start_proc puppet-httpd $daemonargs httpd $httpdargs } start_proc() { local base=$1 local pidfile=$RUNDIR/$base.pid local lockfile=$LOCKDIR/$base shift echo -n $"Starting $base: " eval daemon $* RETVAL=$? [ $RETVAL = 0 ] && touch ${lockfile} echo return $RETVAL } stop() { stop_proc puppet-httpd for pmp in $PUPPETMASTERPORTS ; do stop_proc puppetmaster-$pmp done } stop_proc() { local base=$1 local pidfile=$RUNDIR/$base.pid local lockfile=$LOCKDIR/$base echo -n $"Stopping $base: " killproc -p $pidfile $base RETVAL=$? [ $RETVAL -eq 0 ] && rm -f "$lockfile" echo return $RETVAL } status_pm() { for pmp in $PUPPETMASTERPORTS ; do status_proc puppetmaster-$pmp done status_proc puppet-httpd } status_proc() { local base=$1 local pidfile=$RUNDIR/$base.pid local lockfile=$LOCKDIR/$base status -p $pidfile $base } case "$1" in start) start ;; stop) stop ;; restart|reload|force-reload) stop start ;; status) status_pm ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" exit 1 esac exit $RETVAL
This paste will be private.
From the Design Piracy series on my blog: