blob: 5c695b3533e0ea96b12df391dbef79d9f5beb601 (
plain)
1 #!//bin/sh
2 #
3 # /etc/rc.d/distccd: start/stop distcc daemon
4 #
5
6 USER="distcc"
7 GROUP="distcc"
8 RUNDIR="/run/distcc"
9 PIDFILE="$RUNDIR/distcc.pid"
10 PROG="/usr/sbin/distccd"
11 ARGS="--daemon --pid-file $PIDFILE"
12
13 # Allow overriding variables in separate file (except for PATH)
14 . /etc/distccd.conf
15 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
16
17 case $1 in
18 start)
19 [ -d "$RUNDIR" ] || install -o $USER -g $GROUP -d "$RUNDIR"
20 start-stop-daemon --start --pidfile $PIDFILE --exec $PROG -- $ARGS
21 ;;
22 stop)
23 start-stop-daemon --stop --retry 60 --user $USER --pidfile $PIDFILE --remove-pidfile
24 ;;
25 restart)
26 $0 stop
27 $0 start
28 ;;
29 status)
30 start-stop-daemon --status --user $USER --pidfile $PIDFILE
31 case $? in
32 0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
33 1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
34 3) echo "$PROG not running" ;;
35 4) echo "Unable to determine program status" ;;
36 esac
37 ;;
38 *)
39 echo "usage: $0 [start|stop|status|restart]"
40 ;;
41 esac
42
43 # End of file
|