Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2017 09:24:10 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r449332 - in head/net-mgmt/nrpe: . files
Message-ID:  <201709060924.v869OAJV064604@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Wed Sep  6 09:24:10 2017
New Revision: 449332
URL: https://svnweb.freebsd.org/changeset/ports/449332

Log:
  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
  Sponsored by:	Absolight

Modified:
  head/net-mgmt/nrpe/Makefile   (contents, props changed)
  head/net-mgmt/nrpe/files/nrpe2.in

Modified: head/net-mgmt/nrpe/Makefile
==============================================================================
--- head/net-mgmt/nrpe/Makefile	Wed Sep  6 09:01:45 2017	(r449331)
+++ head/net-mgmt/nrpe/Makefile	Wed Sep  6 09:24:10 2017	(r449332)
@@ -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}
 

Modified: head/net-mgmt/nrpe/files/nrpe2.in
==============================================================================
--- head/net-mgmt/nrpe/files/nrpe2.in	Wed Sep  6 09:01:45 2017	(r449331)
+++ head/net-mgmt/nrpe/files/nrpe2.in	Wed Sep  6 09:24:10 2017	(r449332)
@@ -48,6 +48,7 @@ nrpe2_prestart()
 {
 	find_pidfile
 	install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
+	rm -f ${pidfile}
 }
 
 run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709060924.v869OAJV064604>