Annotation of /trunk/distcc/distccd.rc
Parent Directory | Revision Log
Revision 144 -
(hide annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 5 months ago) by niro
File size: 1229 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 5 months ago) by niro
File size: 1229 byte(s)
-import
1 | niro | 144 | #!/bin/bash |
2 | |||
3 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k | ||
4 | #%start: 23 | ||
5 | #%stop: 47 | ||
6 | |||
7 | #deps | ||
8 | #%needs: | ||
9 | #%before: | ||
10 | #%after: | ||
11 | |||
12 | source /etc/sysconfig/rc | ||
13 | source $rc_functions | ||
14 | source /etc/conf.d/distccd | ||
15 | |||
16 | case "$1" in | ||
17 | start) | ||
18 | echo -e ${COLOREDSTAR}"Starting distccd ..." | ||
19 | |||
20 | # kill pidfile if exist | ||
21 | [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null | ||
22 | |||
23 | # force user distcc to be owner of /var/run/distccd | ||
24 | chown distcc $(dirname ${DISTCCD_PIDFILE}) &>/dev/null | ||
25 | |||
26 | TMPDIR="${TMPDIR}" \ | ||
27 | /sbin/start-stop-daemon --start --quiet --startas ${DISTCCD_EXEC} \ | ||
28 | --pidfile ${DISTCCD_PIDFILE} -- \ | ||
29 | --pid-file ${DISTCCD_PIDFILE} -N ${DISTCCD_NICE} --user distcc \ | ||
30 | --daemon ${DISTCCD_OPTS} | ||
31 | |||
32 | evaluate_retval | ||
33 | ;; | ||
34 | stop) | ||
35 | echo -e ${COLOREDSTAR}"Stopping distccd ..." | ||
36 | start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}" | ||
37 | rm -f "${DISTCCD_PIDFILE}" | ||
38 | evaluate_retval | ||
39 | ;; | ||
40 | restart) | ||
41 | $0 stop | ||
42 | sleep 1 | ||
43 | $0 start | ||
44 | ;; | ||
45 | status) | ||
46 | statusproc ${DISTCCD_EXEC} | ||
47 | ;; | ||
48 | *) | ||
49 | echo "Usage: $0 {start|stop|restart|status}" | ||
50 | exit 1 | ||
51 | ;; | ||
52 | esac |