summaryrefslogtreecommitdiffstats
path: root/meta/packages/distcc/files
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2007-04-27 13:23:08 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2007-04-27 13:23:08 +0000
commit0b01f1f9638018ad4727045b0620a9d5a6d0381a (patch)
treefe2ca59cc1aa5c8f9febbfb340afb0ba4551df9e /meta/packages/distcc/files
parent64d91d2b96991c1c8ce28f26f6f401a9b8bea9f6 (diff)
downloadpoky-0b01f1f9638018ad4727045b0620a9d5a6d0381a.tar.gz
distcc: autostart distccd on boot
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1570 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/distcc/files')
-rw-r--r--meta/packages/distcc/files/default19
-rwxr-xr-xmeta/packages/distcc/files/distcc98
2 files changed, 117 insertions, 0 deletions
diff --git a/meta/packages/distcc/files/default b/meta/packages/distcc/files/default
new file mode 100644
index 0000000000..95290f8488
--- /dev/null
+++ b/meta/packages/distcc/files/default
@@ -0,0 +1,19 @@
1# Defaults for distcc initscript
2# sourced by /etc/init.d/distcc
3
4#
5# should distcc be started on boot?
6#
7# STARTDISTCC="true"
8
9STARTDISTCC="true"
10
11#
12# Which networks/hosts should be allowed to connect to the daemon?
13# You can list multiple hosts/networks separated by spaces.
14# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
15# Hosts are represented by a single IP Adress
16#
17# ALLOWEDNETS="127.0.0.1"
18
19ALLOWEDNETS="192.168.7.0/24"
diff --git a/meta/packages/distcc/files/distcc b/meta/packages/distcc/files/distcc
new file mode 100755
index 0000000000..bbd4707497
--- /dev/null
+++ b/meta/packages/distcc/files/distcc
@@ -0,0 +1,98 @@
1#!/bin/sh
2#
3# distccd Debian init.d script contributed by Jason Thomas. (Debian #161136)
4#
5# skeleton example file to build /etc/init.d/ scripts.
6# This file should be used to construct scripts for /etc/init.d.
7#
8# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
9# Modified for Debian GNU/Linux
10# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
11#
12# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl
13#
14
15PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16DAEMON=/usr/bin/distccd
17NAME=distcc
18DESC="Distributed Compiler Daemon"
19DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon"
20# please change those variables by overriding them in /etc/defaults/distcc
21ALLOWEDNETS="127.0.0.1"
22
23# Reads config file (will override defaults above)
24[ -r /etc/default/distcc ] && . /etc/default/distcc
25
26test -x $DAEMON || exit 0
27
28set -e
29
30# construct access list
31ALLOW=""
32for net in $ALLOWEDNETS
33do
34 ALLOW="$ALLOW --allow $net"
35done
36
37should_start() {
38 if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then
39 echo "STARTDISTCC is set to false in /etc/default/distcc"
40 echo "$DAEMON not starting"
41 exit 0
42 fi
43}
44
45case "$1" in
46 start)
47 should_start
48 echo -n "Starting $DESC: $NAME"
49 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
50 --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
51 {
52 code=$?
53 echo "$0: start failed with error code $code" >&2
54 exit $code
55 }
56 echo "."
57 ;;
58 stop)
59 echo -n "Stopping $DESC: $NAME"
60 start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
61 --exec $DAEMON ||
62 {
63 code=$?
64 echo "$0: stop failed with error code $code" >&2
65 exit $code
66 }
67 echo "."
68 ;;
69 restart|force-reload)
70 #
71 # If the "reload" option is implemented, move the "force-reload"
72 # option to the "reload" entry above. If not, "force-reload" is
73 # just the same as "restart".
74 #
75 echo -n "Restarting $DESC: $NAME"
76 start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
77 --exec $DAEMON
78 sleep 1
79 should_start
80 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
81 --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
82 {
83 code=$?
84 echo "$0: restart failed with error code $code" >&2
85 exit $code
86 }
87 echo "."
88 ;;
89 *)
90 N=/etc/init.d/$NAME
91 echo "Usage: $N {start|stop|restart|force-reload}" >&2
92 exit 1
93 ;;
94esac
95
96exit 0
97
98