aboutsummaryrefslogtreecommitdiffstats
path: root/main/nrpe/nrpe.initd
blob: 0bff759cee687387601820cd3fe599e5709de0bf (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
#!/sbin/runscript

# Sample init.d file for alpine linux.

daemon=/usr/bin/nrpe
conf=/etc/nrpe.cfg

depend() {
	need net
	after firewall
}

get_pidfile() {
	if [ -r $conf ]; then
		pidfile=$(awk -F= '/^pid_file/ {print $2}' $conf)
	fi
	pidfile=${pidfile:-/var/run/nrpe.pid}
}

start() {
	get_pidfile
	ebegin "Starting NRPE"
		start-stop-daemon --start --quiet \
			--pidfile $pidfile \
			--exec $daemon -- ${nrpe_options:- -c $conf -d}
	eend $?
}

stop() {
	get_pidfile
	ebegin "Stopping NRPE"
		start-stop-daemon --stop --quiet \
			--exec $daemon \
			--pidfile $pidfile
	eend $?
}