[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [hobbit] Hobbit startup script.



Find something simple (like the syslog startup script) and hack it into a xymon startup script.  For the start command, "su - hobbit -c <wherever>runclient.sh".

Here is an example that I use:

#!/sbin/sh
#
#       Greg Hubbard, EDS, January 2006
#
#       Made from Solaris syslog startup script

BBHOME=/app/hobbit/client; export BBHOME
BBUSER=xymon; export BBUSER
HOST="`uname -n`.domain.com"

case "$1" in
'start')
        if [ -f $BBHOME/runclient.sh ]; then
                echo 'Hobbit client starting.'
                #
                su - $BBUSER -c "cd $BBHOME; ./runclient.sh --hostname=$HOST start"
        fi
        ;;

'stop')
        if [ -f $BBHOME/runclient.sh ]; then

                su - $BBUSER -c "cd $BBHOME; ./runclient.sh stop"
        fi
        ;;

*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
This is for a client.  The server startup is similar, except it runs the server startup script.  This is not the most clever or elaborate of scripts, but it does work for me.


________________________________
From: David Peters [mailto:davidp (at) electronf.com]
Sent: Friday, June 05, 2009 5:09 AM
To: hobbit (at) hswn.dk
Subject: [hobbit] Hobbit startup script.

Hi,

I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.

When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:

su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob
bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"

why is it done this way rather than as above, thus allowing the server to start out of init.d?