Date: Sat, 15 Apr 2006 18:54:52 +0200 (CEST) From: Martin Matuska <martin@matuska.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/95811: [UPDATE] net-mgmt/nrpe from 2.0_1 to 2.5.1 Message-ID: <20060415165452.2239622AC7@mail.vx.sk> Resent-Message-ID: <200604151700.k3FH0blI063974@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 95811 >Category: ports >Synopsis: [UPDATE] net-mgmt/nrpe from 2.0_1 to 2.5.1 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Apr 15 17:00:36 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Martin Matuska >Release: FreeBSD 6.0-RELEASE >Organization: >Environment: FreeBSD 6.0-RELEASE i386 amd64 >Description: Update of net-mgmt/nrpe from 2.0_1 to 2.5.1 Removed files: files/patch-pid-file >How-To-Repeat: >Fix: diff -Nbur net-mgmt/nrpe2.orig/Makefile net-mgmt/nrpe2/Makefile --- net-mgmt/nrpe2.orig/Makefile Sat Apr 15 13:01:46 2006 +++ net-mgmt/nrpe2/Makefile Sat Apr 15 13:17:13 2006 @@ -6,8 +6,7 @@ # PORTNAME= nrpe2 -PORTVERSION= 2.0 -PORTREVISION= 1 +PORTVERSION= 2.5.1 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= nagios @@ -44,9 +43,12 @@ CONFIGURE_ARGS+= --enable-command-args .endif +post-build: + @${REINPLACE_CMD} -e 's|nrpe.pid|nrpe2.pid|g' ${WRKSRC}/sample-config/nrpe.cfg + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${PREFIX}/sbin/nrpe2 ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${PREFIX}/libexec/nagios/check_nrpe2 - ${INSTALL_DATA} ${WRKSRC}/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample + ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample .include <bsd.port.post.mk> diff -Nbur net-mgmt/nrpe2.orig/distinfo net-mgmt/nrpe2/distinfo --- net-mgmt/nrpe2.orig/distinfo Sat Apr 15 13:01:46 2006 +++ net-mgmt/nrpe2/distinfo Sat Apr 15 13:02:57 2006 @@ -1,3 +1,3 @@ -MD5 (nrpe-2.0.tar.gz) = 70ef9502a3b7e49fa520dbceabfa04d0 -SHA256 (nrpe-2.0.tar.gz) = 37402fc845c3bba69720cb3fd1598b4589e24600dced1bfaeceeb51ab801f2de -SIZE (nrpe-2.0.tar.gz) = 52157 +MD5 (nrpe-2.5.1.tar.gz) = e083553deaf47a79fd23906d823afc59 +SHA256 (nrpe-2.5.1.tar.gz) = a23a0a37d81900d03884898bd0ae9b9da95348cc4a08695a4c229337c83fbe5e +SIZE (nrpe-2.5.1.tar.gz) = 100382 diff -Nbur net-mgmt/nrpe2.orig/files/patch-pid-file net-mgmt/nrpe2/files/patch-pid-file --- net-mgmt/nrpe2.orig/files/patch-pid-file Sat Apr 15 13:01:46 2006 +++ net-mgmt/nrpe2/files/patch-pid-file Thu Jan 1 01:00:00 1970 @@ -1,76 +0,0 @@ ---- orig/nrpe-2.0/src/Makefile.in Tue Aug 5 07:01:53 2003 -+++ src/Makefile.in Tue May 17 00:25:33 2005 -@@ -9,7 +9,7 @@ - SRC_COMMON=../common - - CC=@CC@ --CFLAGS=@CFLAGS@ @DEFS@ -+CFLAGS=@CFLAGS@ @DEFS@ -DPID_DIR=\"/var/run/\" - LDFLAGS=@LDFLAGS@ @LIBS@ - SOCKETLIBS=@SOCKETLIBS@ - ---- orig/nrpe-2.0/src/nrpe.c Tue Sep 9 04:52:37 2003 -+++ src/nrpe.c Tue May 17 00:24:29 2005 -@@ -23,6 +23,7 @@ - #include "nrpe.h" - #include "utils.h" - -+ - #ifdef HAVE_SSL - #include "dh.h" - #endif -@@ -83,7 +84,6 @@ - #endif - - -- - int main(int argc, char **argv){ - int result=OK; - int x; -@@ -219,7 +219,45 @@ - - /* else daemonize and start listening for requests... */ - else if(fork()==0){ -- -+#ifdef PID_DIR -+ int fd; -+ int pid_written = 0; -+ char *pid_fname; -+ char pbuf[16]; -+ char *bname = strrchr(argv[0], '/'); /* basename from XPG4.2 would be nice */ -+ -+ bname = !bname ? argv[0] : ++bname; -+ pid_fname = malloc(strlen(PID_DIR) + strlen(bname) + sizeof(".pid")); -+ strcpy(pid_fname, PID_DIR); -+ strcat(pid_fname, bname); strcat(pid_fname, ".pid"); -+ if ((fd = open (pid_fname, O_RDONLY)) >= 0) { -+ int status = read (fd, pbuf, (sizeof pbuf) - 1); -+ close (fd); -+ if (status > 0) { -+ int pid; -+ pbuf [status] = 0; -+ pid = atoi (pbuf); -+ /* If the previous server process is not still running, -+ write a new pid file immediately. */ -+ if (pid && (pid == getpid() || kill (pid, 0) < 0)) { -+ unlink (pid_fname); -+ } else { -+ syslog(LOG_ERR,"There's already a nrpe server running."); -+ free(pid_fname); -+ return STATE_CRITICAL; -+ } -+ } -+ } -+ if ((fd = open (pid_fname, O_WRONLY | O_CREAT, 0644)) >= 0) { -+ sprintf (pbuf, "%d\n", (int)getpid ()); -+ write (fd, pbuf, strlen (pbuf)); -+ close (fd); -+ } else { -+ syslog(LOG_ERR,"Can not write the pidfile(%s).", pid_fname); -+ } -+ free(pid_fname); -+#endif -+ - /* we're a daemon - set up a new process group */ - setsid(); - >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060415165452.2239622AC7>