[Pkg-nagios-changes] [pkg-nrpe] 01/03: Add systemd service file and tmpfiles.d configuration. (closes: #665422)

Bas Couwenberg sebastic at debian.org
Fri Dec 23 22:20:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pkg-nrpe.

commit b804bb3632f8a1f2539bb041ff74dd242f8fc0e7
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Dec 23 22:35:01 2016 +0100

    Add systemd service file and tmpfiles.d configuration. (closes: #665422)
---
 debian/changelog                  |  7 +++++++
 debian/control                    |  1 +
 debian/nagios-nrpe-server.default | 22 +++++++++++-----------
 debian/nagios-nrpe-server.init    |  6 +-----
 debian/nagios-nrpe-server.service | 22 ++++++++++++++++++++++
 debian/nagios-nrpe-server.tmpfile |  2 ++
 debian/rules                      |  2 +-
 7 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e52e927..b95b105 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+nagios-nrpe (3.0.1-2) UNRELEASED; urgency=medium
+
+  * Add systemd service file and tmpfiles.d configuration.
+    (closes: #665422)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 23 Dec 2016 22:29:57 +0100
+
 nagios-nrpe (3.0.1-1) unstable; urgency=medium
 
   * Update check_nrpe.cfg to remove command with arguments.
diff --git a/debian/control b/debian/control
index 7746179..59cb099 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Section: net
 Priority: optional
 Build-Depends: debhelper (>= 9),
                dh-autoreconf,
+               dh-systemd,
                libssl1.0-dev,
                libwrap0-dev,
                openssl
diff --git a/debian/nagios-nrpe-server.default b/debian/nagios-nrpe-server.default
index 689c932..4a263d2 100644
--- a/debian/nagios-nrpe-server.default
+++ b/debian/nagios-nrpe-server.default
@@ -1,18 +1,18 @@
 # defaults file for nagios-nrpe-server
 # (this file is a /bin/sh compatible fragment)
 
-# DAEMON_OPTS are any extra cmdline parameters you'd like to
-#             pass along to the nrpe daemon
-#DAEMON_OPTS="--no-ssl"
+# NRPE_OPTS are any extra cmdline parameters you'd like to pass along to the
+# nrpe daemon.
+#
+# The -n option disables SSL support.
+# Don't remove this option before configuring SSL in /etc/nagios/nrpe.cfg!
+# See /usr/share/doc/nagios-nrpe-server/README.SSL.md.gz for instructions.
+NRPE_OPTS="-n"
 
-# NICENESS is if you want to run the server at a different nice() priority
+# NICENESS is if you want to run the server at a different nice() priority.
+# (only used by the init script)
 #NICENESS=5
 
-# INETD is if you want to run the server via inetd (default=0, run as daemon)
+# INETD is if you want to run the server via inetd (default=0, run as daemon).
+# (only used by the init script)
 #INETD=0
-
-# Enable SSL if you want to support SSL connections to the NRPE daemon.
-# Don't enable this option before configuring SSL in /etc/nagios/nrpe.cfg!
-# See /usr/share/doc/nagios-nrpe-server/README.SSL.md.gz for instructions.
-#USE_SSL=1
-
diff --git a/debian/nagios-nrpe-server.init b/debian/nagios-nrpe-server.init
index 0378a89..5a48217 100644
--- a/debian/nagios-nrpe-server.init
+++ b/debian/nagios-nrpe-server.init
@@ -29,8 +29,6 @@ else
 	exit 1
 fi
 
-NO_SSL="-n"
-
 # Include nagios-nrpe defaults if available
 if [ -f /etc/default/nagios-nrpe-server ] ; then
 	. /etc/default/nagios-nrpe-server
@@ -42,8 +40,6 @@ if [ -f /etc/default/nagios-nrpe ]; then
 fi
 if [ "$NICENESS" ]; then NICENESS="-n $NICENESS"; fi
 
-if [ "$USE_SSL" -eq 1 ]; then NO_SSL=""; fi
-
 #since /var/run can be wiped completly we create our run directory here
 if [ ! -d "$PIDDIR" ]; then 
 	mkdir "$PIDDIR"
@@ -59,7 +55,7 @@ case "$1" in
 		exit 0
 	fi
 	log_daemon_msg "Starting $DESC" "$NAME"
-	start_daemon -p $PIDDIR/nrpe.pid $NICENESS $DAEMON  -c $CONFIG -d $DAEMON_OPTS $NO_SSL
+	start_daemon -p $PIDDIR/nrpe.pid $NICENESS $DAEMON  -c $CONFIG -d $NRPE_OPTS
 	log_end_msg $?
 	;;
   stop)
diff --git a/debian/nagios-nrpe-server.service b/debian/nagios-nrpe-server.service
new file mode 100644
index 0000000..abec2ae
--- /dev/null
+++ b/debian/nagios-nrpe-server.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Nagios Remote Plugin Executor
+Documentation=http://www.nagios.org/documentation
+After=var-run.mount nss-lookup.target network.target local-fs.target remote-fs.target time-sync.target
+Before=getty at tty1.service plymouth-quit.service xdm.service
+Conflicts=nrpe.socket
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+Restart=on-abort
+PIDFile=/var/run/nagios/nrpe.pid
+EnvironmentFile=/etc/default/nagios-nrpe-server
+ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f $NRPE_OPTS
+ExecStopPost=/bin/rm -f /var/run/nagios/nrpe.pid
+TimeoutStopSec=60
+User=nagios
+Group=nagios
+PrivateTmp=true
+OOMScoreAdjust=-500
diff --git a/debian/nagios-nrpe-server.tmpfile b/debian/nagios-nrpe-server.tmpfile
new file mode 100644
index 0000000..d6bdcf3
--- /dev/null
+++ b/debian/nagios-nrpe-server.tmpfile
@@ -0,0 +1,2 @@
+#Type	Path		Mode	UID	GID	Age	Argument
+d	/var/run/nagios	0755	nagios	nagios	-	-
diff --git a/debian/rules b/debian/rules
index e99e175..a4f07d6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,7 +11,7 @@ CFLAGS += $(CPPFLAGS)
 export AUTOHEADER=true
 
 %:
-	    dh $@ --with autoreconf --parallel
+	    dh $@ --with autoreconf,systemd --parallel
 
 override_dh_auto_configure:
 	# Save deterministic "openssl dhparam" output.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nrpe.git



More information about the Pkg-nagios-changes mailing list