| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # Init file for Distccd - A distributed compilation front-end. |
| 4 | # WARNING: Don't enable on untrusted networks |
| 5 | # |
| 6 | # Written by Dag Wieers <[email protected]>. |
| 7 | # |
| 8 | # chkconfig: - 80 20 |
| 9 | # description: Distccd - distributed compilation front-end (daemon) \ |
| 10 | # WARNING: Don't enable on untrusted networks |
| 11 | # |
| 12 | # processname: distccd |
| 13 | # |
| 14 | # config: /etc/sysconfig/distccd |
| 15 | |
| 16 | source /etc/init.d/functionsscip-shell source . . `/etc/init.d/functions`. |
| 17 | source /etc/sysconfig/networkscip-shell source . . `/etc/sysconfig/network`. |
| 18 | |
| 19 | ### Check that networking is up. |
| 20 | [scip-shell system . . `[`. "${NETWORKING}" == "no" ] && exit 0 |
| 21 | |
| 22 | [scip-shell system . . `[`. -x "/usr/bin/distccdscip-shell filesystem . . `/usr/bin/distccd`." ] || exit 1 |
| 23 | |
| 24 | ### Default variables |
| 25 | SYSCONFIG="/etc/sysconfig/distccdscip-shell filesystem . . `/etc/sysconfig/distccd`." |
| 26 | OPTIONS="" |
| 27 | USER="distcc" |
| 28 | DISTCCPATH="$PATH" |
| 29 | |
| 30 | ### Read configuration |
| 31 | [scip-shell system . . `[`. -r "$SYSCONFIG" ] && source "$SYSCONFIG" |
| 32 | |
| 33 | RETVAL=0 |
| 34 | prog="distccd" |
| 35 | desc="Distributed Compiler daemon" |
| 36 | |
| 37 | startscip-shell shell distcc 3.4+really3.4-13 start().() { |
| 38 | echoscip-shell system . . echo. -n $"Starting $desc ($prog): " |
| 39 | PATH="$DISTCCPATH" daemon --user "$USER" $prog --daemon --log-file="/var/log/distccd.log" $OPTIONS |
| 40 | RETVAL=$? |
| 41 | echoscip-shell system . . echo. |
| 42 | [scip-shell system . . `[`. $RETVAL -eq 0 ] && touchscip-shell system . . touch. /var/lock/subsys/$prog |
| 43 | return $RETVAL |
| 44 | } |
| 45 | |
| 46 | stopscip-shell shell distcc 3.4+really3.4-13 stop().() { |
| 47 | echoscip-shell system . . echo. -n $"Shutting down $desc ($prog): " |
| 48 | killproc $prog |
| 49 | RETVAL=$? |
| 50 | echoscip-shell system . . echo. |
| 51 | [scip-shell system . . `[`. $RETVAL -eq 0 ] && rmscip-shell system . . rm. -f /var/lock/subsys/$prog |
| 52 | return $RETVAL |
| 53 | } |
| 54 | |
| 55 | restartscip-shell shell distcc 3.4+really3.4-13 restart().() { |
| 56 | stopscip-shell shell distcc 3.4+really3.4-13 stop(). |
| 57 | startscip-shell shell distcc 3.4+really3.4-13 start(). |
| 58 | } |
| 59 | |
| 60 | case "$1" in |
| 61 | start) |
| 62 | startscip-shell shell distcc 3.4+really3.4-13 start(). |
| 63 | ;; |
| 64 | stop) |
| 65 | stopscip-shell shell distcc 3.4+really3.4-13 stop(). |
| 66 | ;; |
| 67 | restart|reload) |
| 68 | restartscip-shell shell distcc 3.4+really3.4-13 restart(). |
| 69 | ;; |
| 70 | condrestart) |
| 71 | [scip-shell system . . `[`. -e /var/lock/subsys/$prog ] && restartscip-shell shell distcc 3.4+really3.4-13 restart(). |
| 72 | RETVAL=$? |
| 73 | ;; |
| 74 | status) |
| 75 | status $prog |
| 76 | RETVAL=$? |
| 77 | ;; |
| 78 | *) |
| 79 | echoscip-shell system . . echo. $"Usage $0 {start|stop|restart|condrestart|status}" |
| 80 | RETVAL=1 |
| 81 | esac |
| 82 | |
| 83 | exit $RETVAL |