Skip to content

Commit

Permalink
MFH: r449332
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mat813 committed Sep 6, 2017
1 parent 698499d commit 0b48d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion net-mgmt/nrpe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
1 change: 1 addition & 0 deletions net-mgmt/nrpe/files/nrpe2.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ nrpe2_prestart()
{
find_pidfile
install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
rm -f ${pidfile}
}

run_rc_command "$1"

0 comments on commit 0b48d9e

Please sign in to comment.