From owner-svn-ports-all@FreeBSD.ORG Wed Sep 12 20:57:28 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73F351065673; Wed, 12 Sep 2012 20:57:28 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473A58FC12; Wed, 12 Sep 2012 20:57:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8CKvSiv046726; Wed, 12 Sep 2012 20:57:28 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8CKvSP8046722; Wed, 12 Sep 2012 20:57:28 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201209122057.q8CKvSP8046722@svn.freebsd.org> From: Chris Rees Date: Wed, 12 Sep 2012 20:57:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r304163 - in head/net-mgmt/nrpe2: . files X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 20:57:28 -0000 Author: crees Date: Wed Sep 12 20:57:27 2012 New Revision: 304163 URL: http://svn.freebsd.org/changeset/ports/304163 Log: Improve rc script handling of pidfile, and do a few optimisations PR: ports/168225 Submitted by: yar (based on) While here, copy over default config file on install Modified: head/net-mgmt/nrpe2/Makefile head/net-mgmt/nrpe2/files/nrpe2.in head/net-mgmt/nrpe2/pkg-plist Modified: head/net-mgmt/nrpe2/Makefile ============================================================================== --- head/net-mgmt/nrpe2/Makefile Wed Sep 12 20:39:39 2012 (r304162) +++ head/net-mgmt/nrpe2/Makefile Wed Sep 12 20:57:27 2012 (r304163) @@ -74,7 +74,7 @@ CONFIGURE_ARGS+= --disable-command-args .endif post-patch: - @${REINPLACE_CMD} -e 's#/var/run/nrpe.pid#@localstatedir@/nrpe2.pid#g' \ + @${REINPLACE_CMD} -e 's#/var/run/nrpe.pid#/var/run/nrpe2/nrpe2.pid#g' \ -e 's#/usr/lib/nagios/plugins/#${LOCALBASE}/libexec/nagios/#g' \ -e 's#/usr/bin/sudo#${LOCALBASE}/bin/sudo#g' \ ${WRKSRC}/sample-config/nrpe.cfg.in @@ -90,6 +90,8 @@ do-install: post-install: @${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL + @[ -f ${PREFIX}/etc/nrpe.cfg ] || \ + ${CP} -p ${PREFIX}/etc/nrpe.cfg-sample ${PREFIX}/etc/nrpe.cfg @${CAT} ${PKGMESSAGE} .include Modified: head/net-mgmt/nrpe2/files/nrpe2.in ============================================================================== --- head/net-mgmt/nrpe2/files/nrpe2.in Wed Sep 12 20:39:39 2012 (r304162) +++ head/net-mgmt/nrpe2/files/nrpe2.in Wed Sep 12 20:57:27 2012 (r304163) @@ -21,20 +21,18 @@ name="nrpe2" rcvar=nrpe2_enable +: ${nrpe2_enable=NO} +: ${nrpe2_configfile=%%PREFIX%%/etc/nrpe.cfg} +pidfile=${nrpe2_pidfile:-/var/run/nrpe2/nrpe2.pid} + command="%%PREFIX%%/sbin/nrpe2" command_args="-d" extra_commands="reload" - +start_precmd="install -d -o ${nrpe_user:-nagios} ${pidfile%/*}" sig_reload=HUP -[ -z "${nrpe2_enable}" ] && nrpe2_enable="NO" -[ -z "${nrpe2_configfile}" ] && nrpe2_configfile="%%PREFIX%%/etc/nrpe.cfg" -[ -z "${nrpe2_pidfile}" ] && nrpe2_pidfile="%%NAGIOSDIR%%/nrpe2.pid" - load_rc_config "${name}" -pidfile="${nrpe2_pidfile}" - required_files="${nrpe2_configfile}" command_args="${command_args} -c ${nrpe2_configfile}" Modified: head/net-mgmt/nrpe2/pkg-plist ============================================================================== --- head/net-mgmt/nrpe2/pkg-plist Wed Sep 12 20:39:39 2012 (r304162) +++ head/net-mgmt/nrpe2/pkg-plist Wed Sep 12 20:57:27 2012 (r304163) @@ -1,4 +1,6 @@ +@unexec cmp -s %D/etc/nrpe.cfg-sample %D/etc/nrpe.cfg && rm %D/etc/nrpe.cfg || true etc/nrpe.cfg-sample +@exec test -f %B/nrpe.cfg || cp -p %D/%F %B/nrpe.cfg libexec/nagios/check_nrpe2 @dirrmtry libexec/nagios sbin/nrpe2