]> git.pld-linux.org Git - packages/distcc.git/blobdiff - distcc.init
- added as-needed patch
[packages/distcc.git] / distcc.init
index 3db518c69ecdefe0b87d450331a8c763f6517002..fdc6c12347f657e0bb4876b510bf6b55f5631988 100644 (file)
@@ -2,13 +2,12 @@
 #
 # $Id$
 #
-# distccd              distccd 
+# distccd              distccd
 #
 # chkconfig:   345 55 45
 #
-# description: distccd 
-#      
-
+# description: distccd
+#
 
 # Source function library
 . /etc/rc.d/init.d/functions
@@ -21,7 +20,7 @@
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
-       if [ ! -f /var/lock/subsys/network ]; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                msg_network_down distccd
                exit 1
        fi
@@ -29,8 +28,8 @@ else
        exit 0
 fi
 
-OPTION1="--daemon"
-                       
+[ -z "$DISTCC_HOSTS_ALLOW" -a -n "$HOSTS_ALLOW" ] && DISTCC_HOSTS_ALLOW="$HOSTS_ALLOW"
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -38,9 +37,11 @@ case "$1" in
        # 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
+               touch distcc /var/log/distcc
+               chown distcc /var/log/distcc
+               daemon /usr/bin/distccd --daemon --user distcc --log-file /var/log/distcc `for ip in $DISTCC_HOSTS_ALLOW; do echo -n "--allow $ip "; done` $DISTCC_OPTS
                RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/distccd             
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/distccd
        else
                msg_already_running distccd
        fi
@@ -52,7 +53,7 @@ case "$1" in
                rm -f /var/run/distccd.pid /var/lock/subsys/distccd >/dev/null 2>&1
        else
                msg_not_running distccd
-       fi      
+       fi
        ;;
   restart)
        $0 stop
@@ -81,4 +82,4 @@ esac
 exit $RETVAL
 
 # This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
+# vi:syntax=sh:tw=78:ts=4:sw=4
This page took 0.070137 seconds and 4 git commands to generate.