Commit 6f26dafc authored by Natanael Copa's avatar Natanael Copa

testing/nrpe: added init.d script based on stuff from Jeff

fixes #201
parent 7705d03c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: # Maintainer:
pkgname=nrpe pkgname=nrpe
pkgver=2.12 pkgver=2.12
pkgrel=0 pkgrel=1
pkgusers="nagios" pkgusers="nagios"
pkggroups="nagios" pkggroups="nagios"
pkgdesc="NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines." pkgdesc="NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines."
...@@ -10,9 +10,10 @@ url="http://www.nagios.org/download/addons" ...@@ -10,9 +10,10 @@ url="http://www.nagios.org/download/addons"
license="GPL" license="GPL"
depends="" depends=""
makedepends="openssl-dev perl" makedepends="openssl-dev perl"
install= install="nrpe.pre-install"
subpackages= subpackages=
source="http://downloads.sourceforge.net/nagios/$pkgname-$pkgver.tar.gz" source="http://downloads.sourceforge.net/nagios/$pkgname-$pkgver.tar.gz
nrpe.initd"
build() { build() {
cd "$srcdir"/$pkgname-$pkgver cd "$srcdir"/$pkgname-$pkgver
...@@ -26,7 +27,9 @@ build() { ...@@ -26,7 +27,9 @@ build() {
package() { package() {
cd "$srcdir"/$pkgname-$pkgver cd "$srcdir"/$pkgname-$pkgver
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install install-daemon-config
install -Dm755 ../nrpe.initd "$pkgdir"/etc/init.d/nrpe
} }
md5sums="b2d75e2962f1e3151ef58794d60c9e97 nrpe-2.12.tar.gz" md5sums="b2d75e2962f1e3151ef58794d60c9e97 nrpe-2.12.tar.gz
a1e3fbbfdd46437f7385742d49d5eb85 nrpe.initd"
#!/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 $?
}
#!/bin/sh
adduser -H -h /dev/null -s /bin/false -D nagios 2>/dev/null
addgroup nagios 2>/dev/null
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment