diff options
author | Danny Rawlins <monster.romster@gmail.com> | 2015-04-09 19:55:03 +1000 |
---|---|---|
committer | Danny Rawlins <monster.romster@gmail.com> | 2015-04-09 19:55:03 +1000 |
commit | 56c759778093c9994f33e25b31e4d28310d17584 (patch) | |
tree | 656b56f09d6a4fa3a347092baaae7ae765b2c523 /uptimed/uptimed.rc | |
parent | 483ed10f126f8b96845a45b0e9eb5d03a9aeb060 (diff) | |
download | contrib-56c759778093c9994f33e25b31e4d28310d17584.tar.gz contrib-56c759778093c9994f33e25b31e4d28310d17584.tar.xz |
uptimed: 0.3.16 -> 0.4.0
Diffstat (limited to 'uptimed/uptimed.rc')
-rwxr-xr-x | uptimed/uptimed.rc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/uptimed/uptimed.rc b/uptimed/uptimed.rc new file mode 100755 index 000000000..b04ff8218 --- /dev/null +++ b/uptimed/uptimed.rc @@ -0,0 +1,35 @@ +#!/bin/sh +# +# /etc/rc.d/uptimed: start/stop uptime record tracking daemon +# + +SSD=/sbin/start-stop-daemon +PROG=/usr/sbin/uptimed +PID=/var/run/uptimed.pid +OPTS="-p $PID" + +case $1 in +start) + $PROG -b + $SSD --start --pidfile $PID --exec $PROG -- $OPTS + ;; +stop) + $SSD --stop --retry 10 --pidfile $PID + ;; +restart) + $0 stop + $0 start + ;; +status) + $SSD --status --pidfile $PID + case $? in + 0) echo "$PROG is running with pid $(cat $PID)" ;; + 1) echo "$PROG is not running but the pid file $PID exists" ;; + 3) echo "$PROG is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac + ;; +*) + echo "usage: $0 [start|stop|restart|status]" + ;; +esac |