#! /bin/sh ### BEGIN INIT INFO # Provides: a310 # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start A310 HV amp-meter DIM daemon ### END INIT INFO export DIM_DNS_NODE=trd01 export EXECUTABLE=/usr/local/bin/a310-dimsrv export PIDFILE=/var/run/a310.pid . /etc/rc.status case "$1" in start) echo -n "Starting A310 daemon" startproc -p $PIDFILE -l /var/log/a310 $EXECUTABLE rc_status -v ;; stop) echo -n "Shutting down A310 daemon" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. killproc -p $PIDFILE -TERM $EXECUTABLE rc_status -v ;; try-restart) ## Stop the service and if this succeeds (i.e. the ## service was running before), start it again. $0 status >/dev/null && $0 restart # Remember status and be quiet rc_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; force-reload|reload) ## Signal the daemon to reload its config. Most daemons ## do this on signal 1 (SIGHUP). $0 stop $0 start rc_status -v ;; status) echo -n "Checking for service sshd " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running checkproc -p $PIDFILE $EXECUTABLE rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac rc_exit