summaryrefslogtreecommitdiff
path: root/doc/example
diff options
context:
space:
mode:
authorcsilvers <csilvers@01de4be4-8c4a-0410-9132-4925637da917>2008-04-11 22:36:40 +0000
committercsilvers <csilvers@01de4be4-8c4a-0410-9132-4925637da917>2008-04-11 22:36:40 +0000
commit6b117b70f948dc72b107dab6d3e9ac99be297b6d (patch)
tree1726969de95d86fc5647af1eeb99ea0489ba91c4 /doc/example
parent204634dc3c7d4662fab0132140f1ac59e8c9312b (diff)
downloaddistcc-6b117b70f948dc72b107dab6d3e9ac99be297b6d.tar.gz
The first step of moving everything in the distcc directory to the top
level. I'm doing this in two stages, because I don't understand svn enough to be confident to do it in one. This first stage just copies all the files from distcc/FOO to FOO. Now there are two copies of each file under distcc; the Makefile/etc uses the one in distcc and ignores the one at the top level. The next commit will delete everything under distcc, and rewrite the Makefile/etc to use the top-level versions instead. git-svn-id: http://distcc.googlecode.com/svn/trunk@22 01de4be4-8c4a-0410-9132-4925637da917
Diffstat (limited to 'doc/example')
-rw-r--r--doc/example/init80
-rw-r--r--doc/example/init-suse96
-rw-r--r--doc/example/logrotate12
-rw-r--r--doc/example/xinetd26
4 files changed, 214 insertions, 0 deletions
diff --git a/doc/example/init b/doc/example/init
new file mode 100644
index 0000000..e6ff03a
--- /dev/null
+++ b/doc/example/init
@@ -0,0 +1,80 @@
+#! /bin/sh
+#
+# chkconfig: - 60 20
+# description: The distcc deamon
+# http://distcc.samba.org
+#
+# 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 $?
diff --git a/doc/example/init-suse b/doc/example/init-suse
new file mode 100644
index 0000000..cf9665f
--- /dev/null
+++ b/doc/example/init-suse
@@ -0,0 +1,96 @@
+#! /bin/sh
+#
+# Copyright (C) 2002 C. Brandon Forehand
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# /etc/init.d/distcc
+#
+# and symbolic link
+#
+# /usr/sbin/rcdistcc
+#
+### BEGIN INIT INFO
+# Provides: distccd
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: Start the distcc daemon
+### END INIT INFO
+
+. /etc/rc.status
+. /etc/rc.config
+
+# Determine the base and follow a runlevel link name.
+base=${0##*/}
+link=${base#*[SK][0-9][0-9]}
+
+DISTCC=/usr/local/bin/distccd
+DISTCC_OPTS=--daemon
+DISTCC_USER=daemon
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+# First reset status of this service
+rc_reset
+case "$1" in
+ start)
+ echo -n "Starting distcc daemon"
+ ## Start daemon with startproc(8). If this fails
+ ## the echo return value is set appropriate.
+
+ startproc -u $DISTCC_USER $DISTCC $DISTCC_OPTS
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ stop)
+ echo -n "Shutting down distcc daemon:"
+ ## Stop daemon with killproc(8) and if this fails
+ ## set echo the echo return value.
+
+ killproc -TERM $DISTCC
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ restart)
+ ## If first returns OK call the second, if first or
+ ## second command fails, set echo return value.
+ $0 stop && $0 start
+
+ # Remember status and be quiet
+ rc_status
+ ;;
+ reload)
+ $0 restart
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service distccd: "
+ checkproc $DISTCC && echo OK || echo No process
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart|reload}"
+ exit 1
+ ;;
+esac
+rc_exit
diff --git a/doc/example/logrotate b/doc/example/logrotate
new file mode 100644
index 0000000..2bfe1eb
--- /dev/null
+++ b/doc/example/logrotate
@@ -0,0 +1,12 @@
+# logrotate.d example configuration for distcc, contributed by Dag
+# Wieers.
+
+# The "copytruncate" option means distcc can keep appending to the
+# same filehandle. You would otherwise need to shut down and restart
+# distccd.
+
+/var/log/distccd.log {
+ missingok
+ copytruncate
+ notifempty
+} \ No newline at end of file
diff --git a/doc/example/xinetd b/doc/example/xinetd
new file mode 100644
index 0000000..096dcf4
--- /dev/null
+++ b/doc/example/xinetd
@@ -0,0 +1,26 @@
+# default: off
+
+# xinetd service description for distcc, contributed by akpm, updated
+# by mbp.
+
+# To use this, just check the parameters below and copy this file into
+# /etc/xinet.d/distcc, or the appropriate location for your system,
+# and then restart xinetd. You should also create a 'distcc' user.
+
+# ===> Note that running from inetd is generally NOT recommended for
+# distcc distccd should give better performance when it can run as a
+# standalone daemon and regulate its own load.
+
+service distcc
+{
+ disable = yes
+ socket_type = stream
+ wait = no
+ user = distcc
+ server = /usr/local/bin/distccd
+ server_args = --inetd
+
+ # This makes xinetd cope if there is no service listed in
+ # /etc/services
+ type = UNLISTED
+}