pkgsrc/net/xymon/files/xymon.sh
spz afcc2144d3 fix bugs found by gendalia@:
- transition from BBHOME etc to XYMONHOME etc needed to also happen
  in files/xymon.sh
- vmstat on NetBSD has not shown 3 disks in a while already, so
  vmstat trending for NetBSD clients was off. The disk names that
  remain are left unchanged since for existing rrds a change would
  cause failing data submission
2011-11-16 21:12:34 +00:00

41 lines
998 B
Bash

#!@RCD_SCRIPTS_SHELL@
#
# Xymon site monitoring server
# Startup script contributed by Nathan Arthur (originally for hobbitmon)
#
# PROVIDE: xymon
# REQUIRE: DAEMON xymonclient
name="xymon"
# user-settable rc.conf variables
: ${xymon_launchcfg:="@XYETCDIR@/tasks.cfg"}
: ${xymon_servercfg:="@XYETCDIR@/xymonserver.cfg"}
: ${xymon_log:="@XYMONLOGDIR@/xymonlaunch.log"}
: ${xymon_pidfile:="/var/run/${name}.pid"}
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
rcvar=${name}
xymon_user="xymon"
pidfile=${xymon_pidfile}
required_files="${xymon_launchcfg} ${xymon_servercfg}"
command="@XYBINDIR@/xymonlaunch"
command_args="--config=${xymon_launchcfg} --env=${xymon_servercfg} --log=${xymon_log} --pidfile=${xymon_pidfile}"
xymon_precmd()
{
XYMONHOME="@XYMONHOME@"
export XYMONHOME
XYMONCLIENTHOME="@XYMONHOME@/client"
export XYMONCLIENTHOME
touch ${xymon_pidfile} && chown ${xymon_user} ${xymon_pidfile}
}
start_precmd="xymon_precmd"
load_rc_config $name
run_rc_command "$1"