summaryrefslogtreecommitdiffstats
path: root/main/nrpe/nrpe.initd
blob: 92fe3837ee7c5c8a85af4a4aaa0d219f4dbeaa05 (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 -- -d ${nrpe_options:- -c $conf}
	eend $?
}

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