#!/bin/sh # # init.d script for http_getter # # by --Zack # Created: Wed, 15 Jan 2003 15:14:07 +0100 # Last-Modified: Fri, 17 Jan 2003 16:46:41 +0100 DAEMON="/projects/helm/uwobo_mowgli/uwobo" USAGE="Usage: /etc/init.d/helm-uwobo_mowgli { start | stop | restart }" ENVSCRIPT="" if [ -f /etc/default/helm_mowgli ]; then . /etc/default/helm_mowgli 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"_mowgli.pid do_start () { echo "Starting $DAEMON ..." start-stop-daemon \ --start --background --pidfile $PIDFILE --make-pidfile \ --chuid $OWNER --exec $DAEMON echo "Waiting for UWOBO to startup (2 seconds) ..." sleep 2 /etc/init.d/helm-tomcat_mowgli start } do_stop () { echo "Stopping $DAEMON ..." start-stop-daemon --stop --pidfile $PIDFILE && \ (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi) } case "$1" in start) do_start ;; stop) do_stop ;; restart) do_stop do_start ;; *) echo "$USAGE" >&2 exit 1 ;; esac