about summary refs log tree commit diff stats
path: root/core/conf/rc.d/distccd
blob: 65a166d1dd985d958e4006a1c44b7fe61af452bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# /etc/rc.d/distccd: start/stop distcc daemon
#

. /etc/distcc.conf
if [ -z "$DISTCC_ALLOW" ]; then 
    echo "Please define a range of IPs allowed to connect to this distccd"
    echo "host in DISTCC_ALLOW in /etc/rc.conf. More detailed information"
    echo "can be found in the distcc's README package."
    exit 1
fi

DISTCC_USER="${DISTCC_USER:=nobody}"
DISTCC_LOG_LEVEL="${DISTCC_LOG_LEVEL:=notice}"

case $1 in
start)
	/usr/sbin/distccd --daemon --user "$DISTCC_USER" --allow "$DISTCC_ALLOW" --log-level "$DISTCC_LOG_LEVEL"
	;;
stop)
	killall -q /usr/sbin/distccd
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "usage: $0 [start|stop|restart]"
	;;
esac

# End of file