Xymon Mailing List Archive search

start up script for automatic loading

list Rich Smrcina
Fri, 19 Jan 2007 19:44:38 -0600
Message-Id: <user-f1a9842eae2c@xymon.invalid>

This is the script that I use on SLES9:

#! /bin/sh
### BEGIN INIT INFO
# Provides:       hobbit
# Required-Start: network
# Required-Stop:  network
# Default-Start:  3 5
# Default-Stop:   3
# Description:    Start the hobbit network monitor
### END INIT INFO

case "$1" in
     start)
         echo "Starting Hobbit"
         su - hobbit -c "cd /home/hobbit/server; ./hobbit.sh start"
         ;;
     stop)
         echo "Stopping Hobbit"
         su - hobbit -c "cd /home/hobbit/server; ./hobbit.sh stop"
         ;;
     restart)
         $0 stop
         $0 start
         rc_status
         ;;
     *)
         echo "Usage: $0 {start|stop|restart}"
         exit 1
         ;;
esac


Don Munyak wrote:
Hello,

I'd like to automate startup of hobbit at boot time.

If I make a link from /usr/local/etc/rc.d/hobbit.sh to the startup script
in /usr/local/...hobbit/server/hobbit.sh,  how do I get it to start
using the user account 'hobbit' ?

Is there another preferred technic ?

Thanks

-- 
Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid

Catch the WAVV!  http://www.wavv.org
WAVV 2007 - Green Bay, WI - May 18-22, 2007