summaryrefslogtreecommitdiff
path: root/parallel/ganglia-monitor-core/files/gmond.in
blob: 978173c74bd6cfd2912099859a0abd16bbc1a603 (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
42
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: gmond.in,v 1.1.1.1 2005/02/07 14:33:22 jschauma Exp $
#
# PROVIDE: gmond
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# You will need to set some variables in /etc/rc.conf to start gmond:
#
# gmond=YES

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="gmond"
rcvar=$name
command="@PREFIX@/sbin/gmond"
required_files="@PKG_SYSCONFDIR@/gmond.conf"
start_cmd="gmond_start"
stop_cmd="gmond_stop"
restart_cmd="gmond_stop ; gmond_start"

gmond_start ()
{
	${command}
}

gmond_stop()
{
	pkill ${name} 2>/dev/null
}

if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]
then
	load_rc_config $name
	run_rc_command "$1"
else
	eval ${start_cmd}
fi