#!/bin/sh
#
-# init.d script for http_getter.pl
+# init.d script for http_getter
#
# by --Zack <zack@cs.unibo.it>
# Created: Tue, 8 Oct 2002 17:18:17 +0200
-# Last-Modified: Tue, 8 Oct 2002 17:18:17 +0200
+# Last-Modified: Fri, 16 Apr 2004 18:21:30 +0200
-DAEMON=/projects/helm/http_getter/http_getter.pl
+DAEMON="/projects/helm/daemons/http_getter/http_getter.opt"
USAGE="Usage: /etc/init.d/helm-http-getter { start | stop | restart }"
-ENVSCRIPT=""
if [ -f /etc/default/helm ]; then
. /etc/default/helm
fi
-if ! [ -f "$ENVSCRIPT" ]; then
- echo "Can't find environment script '$ENVSCRIPT'"
- exit 1
-fi
-. $ENVSCRIPT &> /dev/null
NAME=`basename $DAEMON`
-PIDFILE=/projects/helm/run/$NAME.pid
+PIDFILE=/var/run/$NAME.pid
do_start () {
- echo "Starting $DAEMON ..."
+ echo -n "Starting $DAEMON"
start-stop-daemon \
--start --background --pidfile $PIDFILE --make-pidfile \
--chuid $OWNER --exec $DAEMON
+ echo "done!"
+ echo -n "Starting $DAEMON respawner"
+ /etc/init.d/daemon_respawner.sh -p $PIDFILE \ -m root@localhost \
+ -r http://localhost:58081/help -d `basename $0` &
+ echo "."
}
do_stop () {
- echo "Stopping $DAEMON ..."
+ echo -n "Stopping $DAEMON respawner"
+ /etc/init.d/daemon_respawner.sh -d `basename $0` -s
+ echo "."
+ echo -n "Stopping $DAEMON"
start-stop-daemon --stop --pidfile $PIDFILE && \
(if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
+ echo "."
}
case "$1" in