yselkowitz / rpms / condor

Forked from rpms/condor 6 years ago
Clone
Blob Blame History Raw
--- condor-6.9.5-original/condor.init	2007-11-29 12:47:58.000000000 -0600
+++ condor-6.9.5/condor.init	2007-11-29 12:47:31.000000000 -0600
@@ -0,0 +1,108 @@
+#!/bin/bash
+#
+# condor	This script allows for starting and stopping Condor.
+#
+# chkconfig: - 90 10
+# description: Condor is a high throughput computing batch processing
+# 	       platform.
+# processname: condor_master
+# config: /etc/condor/condor_config
+# pidfile: /var/run/condor_master.pid
+
+### BEGIN INIT INFO
+# Provides: condor_master, Condor daemon manager
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Short-Description: start and stop Condor
+# Description: Condor HTC computing platform
+### END INIT INFO
+
+# The program being managed
+prog=condor_master
+
+lockfile=/var/lock/subsys/$prog
+
+# Source function library
+. /etc/init.d/functions
+
+# Source networking configuration
+[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
+
+# Source Condor configuration
+[ -f /etc/sysconfig/condor ] && . /etc/sysconfig/condor
+
+# Report that the underlying program does not exist
+[ -f /usr/sbin/$prog ] || exit 5
+
+# Check that networking is up
+[ "${NETWORKING}" = "no" ] && exit 1
+
+
+start() {
+    echo -n $"Starting Condor daemons: "
+    daemon --check $prog $prog
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && touch $lockfile
+    return $RETVAL
+}
+
+stop() {
+    echo -n $"Stopping Condor daemons: "
+    killproc $prog
+    RETVAL=$?
+    echo
+    [ $RETVAL -eq 0 ] && rm -f $lockfile
+    return $RETVAL
+}
+
+reload() {
+    echo -n $"Reloading Condor daemons: "
+    condor_reconfig # Always returns 0?
+    RETVAL=$?
+    echo
+    return $RETVAL
+}
+
+
+# 0=running, 1=stopped & pid file exists, 2=stopped & subsys locked, 3=stopped
+status $prog &>/dev/null
+running=$?
+
+case "$1" in
+    start)
+	[ $running -eq 0 ] && exit 0
+	start
+	RETVAL=$?
+	;;
+    stop)
+	[ $running -eq 0 ] || exit 0
+	stop
+	RETVAL=$?
+	;;
+    restart)
+	[ $running -eq 0 ] && stop
+	start
+	RETVAL=$?
+	;;
+    try-restart)
+	[ $running -eq 0 ] || exit 0
+	stop
+	start
+	RETVAL=$?
+	;;
+    reload|force-reload)
+	[ $running -eq 0 ] || exit 7
+	reload
+	RETVAL=$?
+	;;
+    status)
+	status $prog
+	RETVAL=$?
+	;;
+    *)
+	echo $"Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}"
+	RETVAL=2
+esac
+
+exit $RETVAL