-
Notifications
You must be signed in to change notification settings - Fork 0
/
distccd.init_d
executable file
·56 lines (45 loc) · 1.07 KB
/
distccd.init_d
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
### BEGIN INIT INFO
# Provides: distccd
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start distccd at boot time
# Description: Enable service provided by distccd.
### END INIT INFO
# chkconfig: 2345 96 04
# description: Distributed compilation server
DISTCCD=/Developer/usr/bin/distccd
RUN_AS=toolwhip
ALLOW="--allow 0.0.0.0/0"
#JOBS=4
SYSTEM_VERSION="10.5.7 (9J61, i386)"
if [ -n "${RUN_AS}" ] && [ "${RUN_AS}" != "${USER}" ] ; then
SWITCH_USER="sudo -u ${RUN_AS}"
fi
case "$1" in
'start')
echo "Starting distccd"
${SWITCH_USER} "${DISTCCD}" \
--daemon --zeroconf \
${ALLOW} \
${JOBS:+--jobs "${JOBS}"} \
${SYSTEM_VERSION:+--system-version "${SYSTEM_VERSION}"}
;;
'stop')
echo "Stopping distccd"
killall -u "${RUN_AS}" "${DISTCCD}"
;;
'restart')
$0 stop
$0 start
;;
'stopall')
$0 stop
;;
*)
echo "What?" >&2
exit 1
;;
esac