On SLES, we use chkconfig to add the script to the startup.
chkconfig hobbit on
will set up the startup and shutdown links correctly. Linux flavors that don't support chkconfig you'll have to set up the links manually (or use whatever tool your dist provides).
The standard startup process will automatically pass start and stop to the script at the proper time. You can invoke it manually eg: './hobbit start'.
Don Munyak wrote:
On 1/19/07, Rich Smrcina <rsmrcina at wi.rr.com> wrote:
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 ?
Rich,
Thanks for the reply. I think I follow the script. If I'm correct, when the script runs, something passes to the script, a stop, start, or restart command.
But how does this occur? Does simply putting this script in ../etc/rc.d/ make it automatic, or is it a combination of the former + adding something like "hobbit_enable='YES' " withing the rc.conf file ?
Thanks
Don
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- Rich Smrcina VM Assist, Inc. Phone: 414-491-6001 Ans Service: 360-715-2467 rich.smrcina at vmassist.com
Catch the WAVV! http://www.wavv.org WAVV 2007 - Green Bay, WI - May 18-22, 2007