mathopd: new rc script

This commit is contained in:
Juergen Daubert 2015-03-12 12:00:07 +01:00
parent b2acd32727
commit 1035d9a354
3 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,5 @@
ec0d71c0c75986c1c4974320788945cc dir_cgi-1.1.tar.gz
56ed28d0c582903a2c29c9c5f9153e57 mathopd
c59d4a211a5327364aac974d9df20657 mathopd
d17bf698470fccf48b9cf5a70f5b3bc2 mathopd-1.6b15.tar.gz
d2079b5851e665ac7713957fe9d62cb5 mathopd-config.patch
dd645079a41380fbb301da6d5559de84 mathopd.8.gz

View File

@ -4,7 +4,7 @@
name=mathopd
version=1.6b15
release=1
release=2
source=(http://www.mathopd.org/dist/$name-$version.tar.gz \
http://jue.li/misc/dir_cgi/dir_cgi-1.1.tar.gz \
http://www.mathopd.org/doc/mathopd.8.gz \

View File

@ -3,20 +3,32 @@
# /etc/rc.d/mathopd: start/stop mathopd http daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/mathopd
OPTS="-f /etc/mathopd.conf"
case $1 in
start)
/usr/sbin/mathopd -f /etc/mathopd.conf
$SSD --start --exec $PROG -- $OPTS
;;
stop)
killall -q /usr/sbin/mathopd
$SSD --stop --retry 10 --exec $PROG
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running" ;;
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]"
echo "usage: $0 [start|stop|restart|status]"
;;
esac