#!/bin/sh ### BEGIN INIT INFO # Provides: orchestra-conductor # Required-Start: networking # Required-Stop: networking # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Conductor queue manager for Orchestra ### END INIT INFO set -e export PATH="/usr/bin:/bin:/usr/sbin:/sbin" CONDUCTOR=/usr/sbin/conductor test -x "${CONDUCTOR}" || exit 0 CONDUCTOR_ARGS="" ENABLED=no PIDFILE=/var/run/orchestra-conductor.pid if test -f /etc/default/orchestra-conductor; then . /etc/default/orchestra-conductor fi . /lib/lsb/init-functions if [ "${ENABLED}" != "yes" ]; then exit 0 fi case "$1" in start) log_daemon_msg "Starting the Conductor" if start-stop-daemon --start --quiet --oknodo --background --pidfile "${PIDFILE}" --make-pidfile --exec "${CONDUCTOR}" -- ${CONDUCTOR_ARGS}; then log_end_msg 0 else log_end_msg 1 fi ;; stop) log_daemon_msg "Stopping the Conductor" if start-stop-daemon --stop --quiet --oknodo --pidfile "${PIDFILE}" -x "${CONDUCTOR}"; then log_end_msg 0 else log_end_msg 1 fi ;; reload) log_daemon_msg "Asking the Conductor to Reload Configuration" if start-stop-daemon --stop --quiet --signal HUP --pidfile "${PIDFILE}" -x "${CONDUCTOR}"; then log_end_msg 0 else log_end_msg 1 fi ;; status) status_of_proc -p "${PIDFILE}" "${CONDUCTOR}" conductor && exit 0 || exit $? ;; *) log_action_msg "Usage: /etc/init.d/orchestra-conductor {start|stop|reload|status}" exit 1 ;; esac