From: Elan Ruusamäe Date: Thu, 4 Feb 2016 08:59:26 +0000 (+0200) Subject: use common pidfile for status and stop X-Git-Tag: auto/th/nagios-nrpe-2.15-7 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fnagios-nrpe.git;a=commitdiff_plain;h=1527661b1bf027c6b90fb5456568b33d9b518d25 use common pidfile for status and stop --- diff --git a/nagios-nrpe.spec b/nagios-nrpe.spec index 38434ef..689d501 100644 --- a/nagios-nrpe.spec +++ b/nagios-nrpe.spec @@ -2,7 +2,7 @@ Summary: Nagios remote plugin execution service/plugin Summary(pl.UTF-8): Demon i wtyczka zdalnego wywoływania wtyczek Nagios Name: nagios-nrpe Version: 2.15 -Release: 6 +Release: 7 License: GPL v2 Group: Networking Source0: http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz @@ -20,7 +20,7 @@ BuildRequires: openssl-tools BuildRequires: rpmbuild(macros) >= 1.647 Requires(post,preun): /sbin/chkconfig Requires: nagios-common -Requires: rc-scripts +Requires: rc-scripts >= 0.4.1.26 Provides: nagios-core Obsoletes: netsaint-nrpe BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) diff --git a/nrpe.init b/nrpe.init index 3161c73..4cba6ef 100755 --- a/nrpe.init +++ b/nrpe.init @@ -27,6 +27,8 @@ else exit 0 fi +pidfile=/var/run/nrpe/nrpe.pid + start() { if [ -f /var/lock/subsys/nrpe ]; then msg_already_running "Nagios NRPE daemon" @@ -46,7 +48,7 @@ stop() { fi msg_stopping "Nagios NRPE daemon" - killproc --pidfile nrpe/nrpe.pid nrpe + killproc --pidfile $pidfile nrpe rm -f /var/lock/subsys/nrpe } @@ -80,7 +82,7 @@ case "$1" in condrestart 7 ;; status) - status nrpe + status --pidfile $pidfile nrpe exit $? ;; *)