#!/bin/sh # Start/stop the dstar dvap_rptr # ### BEGIN INIT INFO # Provides: dvap_rptr # Required-Start: $null # Required-Stop: $null # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: dvap_rptr # Description: dvap_rptr ### END INIT INFO . /lib/lsb/init-functions DVAP_RPTR_SH=/usr/local/bin/dvap_rptr.sh DVAP_RPTR_BIN=/usr/local/bin/dvap_rptr DVAP_RPTR_PIDFILE=/usr/local/bin/dvap_rptr.sh_pidfile start() { status_of_proc $DVAP_RPTR_SH >/dev/null RETVAL=$? if [ "$RETVAL" = "0" ] ; then echo "$DVAP_RPTR_SH already running" else /bin/rm -rf $DVAP_RPTR_PIDFILE echo -n "Starting $DVAP_RPTR_SH:" start-stop-daemon --make-pidfile --pidfile $DVAP_RPTR_PIDFILE --exec $DVAP_RPTR_SH -S & log_end_msg $? fi } stop() { start-stop-daemon --pidfile $DVAP_RPTR_PIDFILE --retry 5 -K start-stop-daemon --exec $DVAP_RPTR_BIN --retry 5 -K /bin/rm -rf $DVAP_RPTR_PIDFILE } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) echo -n "$DVAP_RPTR_SH " status_of_proc $DVAP_RPTR_SH echo -n "$DVAP_RPTR_BIN " status_of_proc $DVAP_RPTR_BIN ;; *) log_action_msg "Usage: /etc/init.d/dvap_rptr {start|stop|restart|status}" exit 2 ;; esac exit 0