#!/bin/sh # # realprod-nanny-initd start/stop realprod-nanny # # chkconfig: 345 98 24 # description: start/stop realprod-nanny # # written by jwz, 7-Jul-2000 # symlink to this file from /etc/rc.d/init.d/realnanny # then chkconfig realnanny on # # do not name the init.d link something that has "realprod-nanny" as # a substring, or the killall in this script will do bad things. # # don't bother doing "chkconfig realprod on" as this takes care # of that by running "/etc/rc.d/init.d/realprod" directly. # # Source function library. . /etc/rc.d/init.d/functions PATH=/sbin:$PATH PATH=/usr/local/bin:$PATH PATH=/home/jwz/src/realproducer:$PATH export PATH # See how we were called. case "$1" in start) echo -n "Starting realprod-nanny..." # realprod-nanny & # daemon --user realprod realprod-nanny '>/dev/null 2>&1 &' su realprod -c 'exec realprod-nanny' >/dev/null 2>&1 & echo "done." ;; stop) echo -n "Stopping realprod-nanny..." # killall realprod-nanny killproc realprod-nanny echo "done." ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac