aboutsummaryrefslogtreecommitdiffstats
path: root/main/nrpe/nrpe.initd
blob: 71ccc0ad0aa96d17b8030f4a3327afae220743f2 (plain) (blame)
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/openrc-run

# 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 $?
}