diff -Nur plague-0.4.4.1-orig/etc/plague-builder.config plague-0.4.4.1/etc/plague-builder.config --- plague-0.4.4.1-orig/etc/plague-builder.config 2005-08-31 21:29:21.000000000 +0200 +++ plague-0.4.4.1/etc/plague-builder.config 2008-01-09 02:54:42.000000000 +0100 @@ -1 +1,3 @@ CONFIG="/etc/plague/builder/plague-builder.cfg" +PIDFILE="/var/run/plague-builder.pid" +OPTIONS="-l /var/log/plague-builder.log" diff -Nur plague-0.4.4.1-orig/etc/plague-builder.init plague-0.4.4.1/etc/plague-builder.init --- plague-0.4.4.1-orig/etc/plague-builder.init 2006-03-12 06:48:18.000000000 +0100 +++ plague-0.4.4.1/etc/plague-builder.init 2008-01-09 03:02:18.000000000 +0100 @@ -1,46 +1,49 @@ -#!/bin/bash +#!/bin/sh # -# /etc/rc.d/init.d/plague-builder +# plague-builder Plague builder daemon # -# Start a plague builder instance -# -# chkconfig: 345 98 02 -# description: Starts a plague builder instance -# processname: plague-builder -# config: /etc/sysconfig/plague-builder -# pidfile: /var/run/plague-builder.pid +# chkconfig: - 98 02 +# description: Plague builder daemon for build-system slave machines + +### BEGIN INIT INFO +# Provides: plague-builder +# Required-Start: $local_fs $network $named $time +# Required-Stop: $local_fs $network $named $time +# Should-Start: $syslog +# Should-Stop: $syslog +# Short-Description: Plague builder daemon +# Description: The Plague builder daemon does the actual RPM packaging +# on build-system slave machines. +### END INIT INFO # Source function library. . /etc/init.d/functions -servicename="plague-builder" -processname="plague-builder" -pidfile=/var/run/plague-builder.pid -logfile=/var/log/plague-builder.log - -if [ -f /etc/sysconfig/$servicename ]; then -. /etc/sysconfig/$servicename -fi +exec="/usr/bin/plague-builder" +prog="plague-builder" + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog start() { - if [ ! -f /var/lock/subsys/$servicename ]; then - echo -n $"Starting $servicename: " - daemon --check $servicename $processname -d -c $CONFIG -p $pidfile -l $logfile - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename - fi -} + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 + echo -n $"Starting $prog: " + daemon --check $prog $exec -d -c $CONFIG -p $PIDFILE $OPTIONS + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} stop() { - echo -n $"Stopping $servicename: " - killproc -p $pidfile $servicename - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/$servicename - rm -f $pidfile - fi + echo -n $"Stopping $prog: " + killproc -p $PIDFILE -d 5 $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval } restart() { @@ -48,27 +51,51 @@ start } +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p $pidfile $processname - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - [ -f /var/lock/subsys/$servicename ] && restart || : - ;; - *) - echo "Usage: $0 {start|stop|status|reload|restart[|probe]" - exit 1 - ;; + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" + exit 2 esac exit $? diff -Nur plague-0.4.4.1-orig/etc/plague-server.config plague-0.4.4.1/etc/plague-server.config --- plague-0.4.4.1-orig/etc/plague-server.config 2005-08-15 05:18:19.000000000 +0200 +++ plague-0.4.4.1/etc/plague-server.config 2008-01-09 02:54:34.000000000 +0100 @@ -1 +1,3 @@ -CONFIG=/etc/plague/server/plague-server.cfg +CONFIG="/etc/plague/server/plague-server.cfg" +PIDFILE="/var/run/plague-server.pid" +OPTIONS="-l /var/log/plague-server.log" diff -Nur plague-0.4.4.1-orig/etc/plague-server.init plague-0.4.4.1/etc/plague-server.init --- plague-0.4.4.1-orig/etc/plague-server.init 2006-03-12 06:48:18.000000000 +0100 +++ plague-0.4.4.1/etc/plague-server.init 2008-01-09 03:02:11.000000000 +0100 @@ -1,46 +1,50 @@ -#!/bin/bash +#!/bin/sh # -# /etc/rc.d/init.d/plague-server +# plague-server Plague server daemon # -# Start a plague server instance -# -# chkconfig: 345 98 02 -# description: Starts a plague server instance -# processname: plague-server -# config: /etc/sysconfig/plague-server -# pidfile: /var/run/plague-server.pid +# chkconfig: - 98 02 +# description: Plague server daemon for build-system master machines + +### BEGIN INIT INFO +# Provides: plague-server +# Required-Start: $local_fs $network $named $time +# Required-Stop: $local_fs $network $named $time +# Should-Start: $syslog +# Should-Stop: $syslog +# Short-Description: Plague server daemon +# Description: The Plague build-system is a client/server distributed +# build-system for building RPM packages. This package provides the +# master server daemon. +### END INIT INFO # Source function library. . /etc/init.d/functions -servicename="plague-server" -processname="plague-server" -pidfile=/var/run/plague-server.pid -logfile=/var/log/plague-server.log - -if [ -f /etc/sysconfig/$servicename ]; then -. /etc/sysconfig/$servicename -fi +exec="/usr/bin/plague-server" +prog="plague-server" + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog start() { - if [ ! -f /var/lock/subsys/$servicename ]; then - echo -n $"Starting $servicename: " - daemon --check $servicename $processname -d -c $CONFIG -p $pidfile -l $logfile - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename - fi -} + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 + echo -n $"Starting $prog: " + daemon --check $prog $exec -d -c $CONFIG -p $PIDFILE $OPTIONS + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} stop() { - echo -n $"Stopping $servicename: " - killproc -p $pidfile $servicename - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/$servicename - rm -f $pidfile - fi + echo -n $"Stopping $prog: " + killproc -p $PIDFILE -d 5 $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval } restart() { @@ -48,27 +52,51 @@ start } +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p $pidfile $processname - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - [ -f /var/lock/subsys/$servicename ] && restart || : - ;; - *) - echo "Usage: $0 {start|stop|status|reload|restart[|probe]" - exit 1 - ;; + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" + exit 2 esac exit $?