diff options
Diffstat (limited to 'distcc/doc/example')
-rw-r--r-- | distcc/doc/example/init | 80 | ||||
-rw-r--r-- | distcc/doc/example/init-suse | 96 | ||||
-rw-r--r-- | distcc/doc/example/logrotate | 12 | ||||
-rw-r--r-- | distcc/doc/example/xinetd | 26 |
4 files changed, 214 insertions, 0 deletions
diff --git a/distcc/doc/example/init b/distcc/doc/example/init new file mode 100644 index 0000000..e6ff03a --- /dev/null +++ b/distcc/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/distcc/doc/example/init-suse b/distcc/doc/example/init-suse new file mode 100644 index 0000000..cf9665f --- /dev/null +++ b/distcc/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/distcc/doc/example/logrotate b/distcc/doc/example/logrotate new file mode 100644 index 0000000..2bfe1eb --- /dev/null +++ b/distcc/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/distcc/doc/example/xinetd b/distcc/doc/example/xinetd new file mode 100644 index 0000000..096dcf4 --- /dev/null +++ b/distcc/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 +} |