-
-
Notifications
You must be signed in to change notification settings - Fork 290
/
init
80 lines (66 loc) · 1.24 KB
/
init
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/sh
#
# chkconfig: - 60 20
# description: The distcc deamon
# http://code.google.com/p/distcc/
#
# processname: distccd
# This is a Red Hat init.d file to start distccd. To install it, copy
# it into /etc/init.d/distccd, and add appropriate links into the
# rc?.d directories.
# It may need to be tweaked for other distributions or versions.
# You may wish to accept parameters from the user to set access
# control options.
# Get config.
. /etc/sysconfig/network
# Get functions
. /etc/init.d/functions
# Check that networking is up.
if [ ${NETWORKING} = "no" ] ; then
exit 0
fi
RETVAL=0
SERVICE=distccd
start() {
echo -n $"Starting $SERVICE: "
daemon /usr/local/bin/$SERVICE --daemon
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
return $RETVAL
}
stop() {
echo -n $"Stopping $SERVICE: "
killproc $SERVICE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE
return $RETVAL
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $SERVICE
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/$SERVICE ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
exit $?