#!/bin/sh # # $Id$ # # distccd distccd # # chkconfig: 345 55 45 # # description: distccd # # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Get service config [ -f /etc/sysconfig/distccd ] && . /etc/sysconfig/distccd # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network ]; then msg_network_down distccd exit 1 fi else exit 0 fi OPTION1="--daemon" # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/distccd ]; then msg_starting distccd daemon /usr/bin/distccd --user nobody --allow $HOSTS_ALLOW RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/distccd else msg_already_running distccd exit 1 fi ;; stop) if [ -f /var/lock/subsys/distccd ]; then msg_stopping distccd killproc distccd RETVAL=$? rm -f /var/run/distccd.pid /var/lock/subsys/distccd >/dev/null 2>&1 else msg_not_running distccd exit 1 fi ;; restart) $0 stop $0 start ;; status) status distccd exit $? ;; reload|force-reload) if [ -f /var/lock/subsys/distccd ]; then msg_reloading distccd killproc distccd -HUP RETVAL=$? else msg_not_running distccd exit 1 fi ;; *) msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 1 esac exit $RETVAL # This must be last line ! # vi:syntax=sh:tw=78:ts=8:sw=4