[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
init.d scripts for Xymon under Ubuntu 8.04 (hardy)
- To: hobbit (at) hswn.dk
- Subject: init.d scripts for Xymon under Ubuntu 8.04 (hardy)
- From: Thomas Leavitt <thomleavitt (at) gmail.com>
- Date: Fri, 7 Aug 2009 15:25:38 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=KI/Rq0Q82CS+Pj4KSSpV/3mSzvTJBSi7wmLlut/M0O0=; b=DFA0o8kFHExjFagHqjlefyLjl3iCmFPCtWAMDDOq5paSHZasZwy9U3hS8OVoi7JPXW fEwpauOaiORBXldrUlHWFSVLecQUHyihatqG0zShkgvNv4p8DqY4PWbckGFDH7dALxQK orliL58dEV+pN7xkHJJXgnA+hQ18izX8Nvtjc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vyM3EEpxdxSfwlVIFf4SHA9Zk4IrG18lTTx5X+IoGJgouTOQmOqwJjnscEt5MlRkpA M/yxqcw5gh06VpWWfJDARz362r3Z1nIjM3+Zf31M+JKUE2GBaWbqz/GRhewMqfxAgZSw X/2mJqQEfGsCTFyZq5sEJOV5DHHK+NPO4X3hI=
Background:
I'm running Xymon release 4.3.0-0.beta2. Installed via tarball.
I've been trying to adapt the init.d scripts provided with Karmic Koala
(along with the stuff in /etc/hobbit and /usr/share/hobbit/), and I have
Xymon starting (client and server), but for some reason, the bb.html
generated is blank (doesn't list any clients).
I want something more sophisticated than a simple call to hobbit.sh or
runclient.sh, etc., so that's why I'm going with the stuff released in
karmic.
I'm not a super savvy guy script wise, and I'm not fully conversant in how
bb.html is generated (by bbgen)...
Scripts below.
Regards,
Thomas
Note: /etc/hobbit consists of symlinks to files stored in
/home/xymon/server/etc
/etc/init.d/hobbit
#!/bin/sh
# Startup script for the Hobbit monitor
#
# This starts the "hobbitlaunch" tool, which in turn starts
# all of the other Hobbit server programs.
### BEGIN INIT INFO
# Provides: hobbit
# Required-Start: $remote_fs $network
# Should-Start: $all
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Hobbit system monitor server
# Description: Hobbit system monitor, server part.
# (Also monitors the local host.)
### END INIT INFO
PIDFILE=/var/run/hobbit/hobbitlaunch.pid
DAEMON=/home/xymon/server/bin/hobbitlaunch
NAME="hobbitd"
DESC="Hobbit Server"
HOBBITSERVERHOME=/home/xymon/server
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
. /usr/share/hobbit/init-common.sh
# Include hobbitclient defaults if available
if [ -f /etc/default/hobbit-client ] ; then
. /etc/default/hobbit-client
fi
case "$1" in
"start")
create_includefiles
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --exec $DAEMON --chuid xymon --umask 022 --start \
-- \
--config=/etc/hobbit/hobbitlaunch.cfg \
--env=/etc/hobbit/hobbitserver.cfg \
--log=$HOBBITSERVERHOME/logs/hobbitlaunch.log \
--pidfile=$PIDFILE
log_end_msg $?
;;
"stop")
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --exec $DAEMON --pidfile $PIDFILE --stop --retry 5
log_end_msg $?
;;
"status")
if test -s $PIDFILE
then
kill -0 `cat $PIDFILE`
if test $? -eq 0
then
echo "Hobbit (hobbitlaunch) running with PID `cat $PIDFILE`"
exit 0
else
echo "Hobbit not running, removing stale PID file"
rm -f $PIDFILE
exit 1
fi
else
echo "Hobbit (hobbitlaunch) does not appear to be running"
exit 3
fi
;;
"restart")
if test -s $PIDFILE
then
$0 stop
sleep 1
$0 start
else
log_action_msg "hobbitlaunch does not appear to be running, starting it"
$0 start
fi
;;
"reload"|"force-reload")
if test -s $PIDFILE
then
create_includefiles
log_action_msg "Reloading hobbitd config"
kill -HUP `cat /var/run/hobbit/hobbitd.pid`
else
log_action_msg "hobbitd not running (no PID file)"
fi
;;
"rotate")
for PIDFILE in /var/run/hobbit/*.pid
do
test -e $PIDFILE && kill -HUP `cat $PIDFILE`
done
;;
*)
echo "Usage: $0 start|stop|restart|force-reload|reload|status|rotate"
break;
esac
exit 0