Last week I finally finished installing Condor (a distributed computing project) on our machines here. The install packages didn’t seem to include a Debian startup script (or I couldn’t find it), and a little light Googling produced nothing either. So I wrote my own, & reproduce it here to assist the laziness of others.


#! /bin/sh
# /etc/init.d/condor: start and stop Condor

set -e

test -x /soft9/condor/sbin/condor || exit 0

if test -f /etc/default/condor; then
    . /etc/default/condor
fi

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin:/soft9/condor/sbin"
export CONDOR_CONFIG="/soft9/condor/etc/condor_config"
PIDFILE="/var/run/condor.pid"

case "$1" in
  start)
        echo -n "Starting condor"
        start-stop-daemon --start --quiet --exec /soft9/condor/sbin/condor_master -- $CONDOR_OPTS
        PID=`pidof condor_master` || true
        echo $PID > $PIDFILE
        echo "."
        ;;
  stop)
        echo -n "Stopping condor"
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/condor.pid
        echo "."
        ;;

  *)
        echo "Usage: /etc/init.d/condor {start|stop}"
        exit 1
esac

exit 0

I may write more about condor when we’ve been using it a bit longer.