diff options
author | mat <mat@FreeBSD.org> | 2017-09-06 09:26:51 +0000 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2017-09-06 09:26:51 +0000 |
commit | 4c2ebfb3c439ac6b4ea857e576405a523f461873 (patch) | |
tree | cc86a87a56d13222db41b1a55a068967f993b4cf | |
parent | a5c2ba137593610c8c5bc82a0805ec9ada137f5e (diff) | |
download | FreeBSD-ports-4c2ebfb3c439ac6b4ea857e576405a523f461873.zip FreeBSD-ports-4c2ebfb3c439ac6b4ea857e576405a523f461873.tar.gz |
MFH: r449332
Fix not starting after crash.
When nrpe quits ungracefully, for example, if the box was rebooted, it
often does not start because the pid file is still there, and the pid in
it exists and the pid in it is in use by some other process.
The dubious code is in src/nrpe.c in write_pid_file() around line 1756
that could be axed.
But I think the easiest way to fix this is with the attached patch.
precmd is run just before starting the daemon and after checking that it
is not already running.
With this, it starts just fine, and still refuses to start if it is
really already running, but starts fine if the pid file contains a pid
that exists but is not nrpe.
PR: 221740
Submitted by: mat
Approved by: maintainer timeout, ports-secteam blanket
Sponsored by: Absolight
-rw-r--r-- | net-mgmt/nrpe/Makefile | 2 | ||||
-rw-r--r-- | net-mgmt/nrpe/files/nrpe2.in | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index 17e3652..f556ce0 100644 --- a/net-mgmt/nrpe/Makefile +++ b/net-mgmt/nrpe/Makefile @@ -3,7 +3,7 @@ PORTNAME= nrpe DISTVERSION= 2.15 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net-mgmt MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION} diff --git a/net-mgmt/nrpe/files/nrpe2.in b/net-mgmt/nrpe/files/nrpe2.in index 59f94fa..18ce7a0 100644 --- a/net-mgmt/nrpe/files/nrpe2.in +++ b/net-mgmt/nrpe/files/nrpe2.in @@ -48,6 +48,7 @@ nrpe2_prestart() { find_pidfile install -d -o ${nrpe_user:-nagios} ${pidfile%/*} + rm -f ${pidfile} } run_rc_command "$1" |