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