diff options
Diffstat (limited to 'meta/recipes-devtools/distcc/files/distcc')
-rwxr-xr-x | meta/recipes-devtools/distcc/files/distcc | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/recipes-devtools/distcc/files/distcc b/meta/recipes-devtools/distcc/files/distcc new file mode 100755 index 0000000000..513bc483ea --- /dev/null +++ b/meta/recipes-devtools/distcc/files/distcc | |||
@@ -0,0 +1,106 @@ | |||
1 | #!/bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: distcc | ||
4 | # Required-Start: $remote_fs $syslog | ||
5 | # Required-Stop: $remote_fs $syslog | ||
6 | # Default-Start: 2 3 4 5 | ||
7 | # Default-Stop: 1 | ||
8 | # Short-Description: simple distributed compiler client and server | ||
9 | ### END INIT INFO | ||
10 | # | ||
11 | # distccd Debian init.d script contributed by Jason Thomas. (Debian #161136) | ||
12 | # | ||
13 | # skeleton example file to build /etc/init.d/ scripts. | ||
14 | # This file should be used to construct scripts for /etc/init.d. | ||
15 | # | ||
16 | # Written by Miquel van Smoorenburg <miquels@cistron.nl>. | ||
17 | # Modified for Debian GNU/Linux | ||
18 | # by Ian Murdock <imurdock@gnu.ai.mit.edu>. | ||
19 | # | ||
20 | # Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl | ||
21 | # | ||
22 | |||
23 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
24 | DAEMON=/usr/bin/distccd | ||
25 | NAME=distcc | ||
26 | DESC="Distributed Compiler Daemon" | ||
27 | DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon" | ||
28 | # please change those variables by overriding them in /etc/defaults/distcc | ||
29 | ALLOWEDNETS="127.0.0.1" | ||
30 | |||
31 | # Reads config file (will override defaults above) | ||
32 | [ -r /etc/default/distcc ] && . /etc/default/distcc | ||
33 | |||
34 | test -x $DAEMON || exit 0 | ||
35 | |||
36 | set -e | ||
37 | |||
38 | # construct access list | ||
39 | ALLOW="" | ||
40 | for net in $ALLOWEDNETS | ||
41 | do | ||
42 | ALLOW="$ALLOW --allow $net" | ||
43 | done | ||
44 | |||
45 | should_start() { | ||
46 | if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then | ||
47 | echo "STARTDISTCC is set to false in /etc/default/distcc" | ||
48 | echo "$DAEMON not starting" | ||
49 | exit 0 | ||
50 | fi | ||
51 | } | ||
52 | |||
53 | case "$1" in | ||
54 | start) | ||
55 | should_start | ||
56 | echo -n "Starting $DESC: $NAME" | ||
57 | start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ | ||
58 | --exec $DAEMON -- $DAEMON_ARGS $ALLOW || | ||
59 | { | ||
60 | code=$? | ||
61 | echo "$0: start failed with error code $code" >&2 | ||
62 | exit $code | ||
63 | } | ||
64 | echo "." | ||
65 | ;; | ||
66 | stop) | ||
67 | echo -n "Stopping $DESC: $NAME" | ||
68 | start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ | ||
69 | --exec $DAEMON || | ||
70 | { | ||
71 | code=$? | ||
72 | echo "$0: stop failed with error code $code" >&2 | ||
73 | exit $code | ||
74 | } | ||
75 | echo "." | ||
76 | ;; | ||
77 | restart|force-reload) | ||
78 | # | ||
79 | # If the "reload" option is implemented, move the "force-reload" | ||
80 | # option to the "reload" entry above. If not, "force-reload" is | ||
81 | # just the same as "restart". | ||
82 | # | ||
83 | echo -n "Restarting $DESC: $NAME" | ||
84 | start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ | ||
85 | --exec $DAEMON | ||
86 | sleep 1 | ||
87 | should_start | ||
88 | start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ | ||
89 | --exec $DAEMON -- $DAEMON_ARGS $ALLOW || | ||
90 | { | ||
91 | code=$? | ||
92 | echo "$0: restart failed with error code $code" >&2 | ||
93 | exit $code | ||
94 | } | ||
95 | echo "." | ||
96 | ;; | ||
97 | *) | ||
98 | N=/etc/init.d/$NAME | ||
99 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | ||
100 | exit 1 | ||
101 | ;; | ||
102 | esac | ||
103 | |||
104 | exit 0 | ||
105 | |||
106 | |||