summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-11-13 15:34:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-11-13 15:34:44 +0000
commit6f26dafcd32199e15194178c2d8984c8c757f542 (patch)
treeb18a2d594b615fe1b8522d608bd0a53c8267a259 /testing
parent7705d03c2dca95282aed1cc3ad72bbffedd32ad3 (diff)
downloadaports-6f26dafcd32199e15194178c2d8984c8c757f542.tar.bz2
aports-6f26dafcd32199e15194178c2d8984c8c757f542.tar.xz
testing/nrpe: added init.d script based on stuff from Jeff
fixes #201
Diffstat (limited to 'testing')
-rw-r--r--testing/nrpe/APKBUILD13
-rw-r--r--testing/nrpe/nrpe.initd37
-rw-r--r--testing/nrpe/nrpe.pre-install5
3 files changed, 50 insertions, 5 deletions
diff --git a/testing/nrpe/APKBUILD b/testing/nrpe/APKBUILD
index ab7403cb6..ba12953e2 100644
--- a/testing/nrpe/APKBUILD
+++ b/testing/nrpe/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer:
pkgname=nrpe
pkgver=2.12
-pkgrel=0
+pkgrel=1
pkgusers="nagios"
pkggroups="nagios"
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"
license="GPL"
depends=""
makedepends="openssl-dev perl"
-install=
+install="nrpe.pre-install"
subpackages=
-source="http://downloads.sourceforge.net/nagios/$pkgname-$pkgver.tar.gz"
+source="http://downloads.sourceforge.net/nagios/$pkgname-$pkgver.tar.gz
+ nrpe.initd"
build() {
cd "$srcdir"/$pkgname-$pkgver
@@ -26,7 +27,9 @@ build() {
package() {
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"
diff --git a/testing/nrpe/nrpe.initd b/testing/nrpe/nrpe.initd
new file mode 100644
index 000000000..0bff759ce
--- /dev/null
+++ b/testing/nrpe/nrpe.initd
@@ -0,0 +1,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 $?
+}
+
diff --git a/testing/nrpe/nrpe.pre-install b/testing/nrpe/nrpe.pre-install
new file mode 100644
index 000000000..5b7b5f68b
--- /dev/null
+++ b/testing/nrpe/nrpe.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser -H -h /dev/null -s /bin/false -D nagios 2>/dev/null
+addgroup nagios 2>/dev/null
+exit 0