diff options
author | mh <mh@immerda.ch> | 2008-03-30 17:02:17 +0000 |
---|---|---|
committer | mh <mh@immerda.ch> | 2008-03-30 17:02:17 +0000 |
commit | 1d88930631e60cf2996bf1e659265bc12a0e633c (patch) | |
tree | 689caf0f5c9c617a8fb267da51b201315fcbfebb /files/cluster/init.d | |
parent | b99163d6427efa517eb310f388f00051791cb8f2 (diff) |
new version
Diffstat (limited to 'files/cluster/init.d')
-rwxr-xr-x | files/cluster/init.d/puppetmaster.Gentoo | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/files/cluster/init.d/puppetmaster.Gentoo b/files/cluster/init.d/puppetmaster.Gentoo index effd3fc..06c3f69 100755 --- a/files/cluster/init.d/puppetmaster.Gentoo +++ b/files/cluster/init.d/puppetmaster.Gentoo @@ -8,7 +8,7 @@ depend() { use dns logger } -PORTS=[ 18140 18141 18142 18143] +PORTS=( 18140 18141 18142 18143 ) checkconfig() { if [[ ! -d "${PUPPETMASTER_PID_DIR}" ]] ; then @@ -34,24 +34,24 @@ start() { [[ -n "${PUPPETMASTER_MANIFEST}" ]] && options="${options} --manifest=${PUPPETMASTER_MANIFEST}" [[ -n "${PUPPETMASTER_LOG}" ]] && options="${options} --logdest=${PUPPETMASTER_LOG}" [[ -n "${PUPPETMASTER_EXTRA_OPTS}" ]] && options="${options} ${PUPPETMASTER_EXTRA_OPTS}" - - for port in $PORTS; do - ebegin "Starting puppetmaster on port ${port}" - start-stop-daemon --start --quiet --exec /usr/bin/puppetmasterd \ - --pidfile=${PUPPETMASTER_PID_DIR}/puppetmasterd.${port}.pid \ - --servertype=mongrel \ - --masterport="${port}" \ - -- ${options} + for ((i=0; i<${#PORTS[@]}; i++)); do + ebegin "Starting puppetmaster on port ${PORTS[$i]}" + start-stop-daemon --start --quiet --exec /usr/bin/puppetmasterd \ + --pidfile=${PUPPETMASTER_PID_DIR}/puppetmasterd.${PORTS[$i]}.pid \ + -- ${options} \ + --pidfile=${PUPPETMASTER_PID_DIR}/puppetmasterd.${PORTS[$i]}.pid \ + --servertype=mongrel \ + --masterport="${PORTS[$i]}" a=$? || $a - done + done eend $a "Failed to start puppetmaster" } stop() { - for port in $PORTS; do - ebegin "Stopping puppetmaster on port ${port}" + for ((i=0; i<${#PORTS[@]}; i++)); do + ebegin "Stopping puppetmaster on port ${PORTS[$i]}" start-stop-daemon --stop --quiet \ - --pidfile ${PUPPETMASTER_PID_DIR}/puppetmasterd.${port}.pid + --pidfile ${PUPPETMASTER_PID_DIR}/puppetmasterd.${PORTS[$i]}.pid local ret=$? || $ret done eend ${ret} "Failed to stop puppetmaster" |