summaryrefslogtreecommitdiff
path: root/net/xymon/files/xymon.sh
blob: d2769fd3824bdbe0cfa486258ba927c4df6d30f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!@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"