St. Olaf Beowulf Blog

Friday, June 23, 2006

Installing distcc

distcc comes with very incomplete install directions.  Also, embedded in the contrib/redhat directory is an init script for distccd.  Here's my modified copy:
#!/bin/sh
#
# Init file for Distccd - A distributed compilation front-end.
# WARNING: Don't enable on untrusted networks
#
# Written by Dag Wieers .
#
# chkconfig: - 80 20
# description: Distccd - distributed compilation front-end (daemon)     #               WARNING: Don't enable on untrusted networks
#
# processname: distccd
#
# config: /etc/sysconfig/distccd


source /etc/init.d/functions
source /etc/sysconfig/network

### Check that networking is up.
[ "${NETWORKING}" == "no" ] && exit 0

[ -x "/usr/local/bin/distccd" ] || exit 1

### Default variables
SYSCONFIG="/etc/sysconfig/distccd"
OPTIONS="--allow=0.0.0.0/0"
USER="nobody"
DISTCCPATH="$PATH"

### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"

RETVAL=0
prog="distccd"
desc="Distributed Compiler daemon"

start() {
        echo -n $"Starting $desc ($prog): "
        PATH="$DISTCCPATH" daemon --user "$USER" $prog --daemon --log-file="/var/log/distccd.log" $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        return $RETVAL
}

stop() {
        echo -n $"Shutting down $desc ($prog): "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  condrestart)
        [ -e /var/lock/subsys/$prog ] && restart
        RETVAL=$?
        ;;
  status)
        status $prog
        RETVAL=$?
        ;;
  *)
        echo $"Usage $0 {start|stop|restart|condrestart|status}"
        RETVAL=1
esac

exit $RETVAL

The differences between this and the default script include the --allow=0.0.0.0/0 part and the location of the binary (/usr/bin/distccd to /usr/local/bin/distccd)

0 Comments:

Post a Comment

<< Home