From owner-svn-ports-all@freebsd.org Thu Aug 3 13:34:59 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08CB5DBCE99; Thu, 3 Aug 2017 13:34:59 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D934B77D01; Thu, 3 Aug 2017 13:34:58 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73DYwuH041236; Thu, 3 Aug 2017 13:34:58 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DYvNL041232; Thu, 3 Aug 2017 13:34:57 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201708031334.v73DYvNL041232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 3 Aug 2017 13:34:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r447210 - in head/sysutils/munin-node: . files X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: in head/sysutils/munin-node: . files X-SVN-Commit-Revision: 447210 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 03 Aug 2017 13:34:59 -0000 Author: mat Date: Thu Aug 3 13:34:57 2017 New Revision: 447210 URL: https://svnweb.freebsd.org/changeset/ports/447210 Log: Fix starting and stopping munin-asyncd. [1] Turns out creating a start_cmd function is not enough, you have to add a variable, start_cmd and point it to the start_cmd function. As for stopping it, it should work out of the box, but for the fact that munin-asyncd uses setproctitle or something, and it confuses the hell out of rc.subr. While there, pet rclint. PR: 221000 [1] (based on) Submitted by: marcel herrbischoff com Sponsored by: Absolight Modified: head/sysutils/munin-node/Makefile (contents, props changed) head/sysutils/munin-node/files/munin-asyncd.in (contents, props changed) head/sysutils/munin-node/files/munin-node.in head/sysutils/munin-node/files/munin-sched.in Modified: head/sysutils/munin-node/Makefile ============================================================================== --- head/sysutils/munin-node/Makefile Thu Aug 3 13:29:41 2017 (r447209) +++ head/sysutils/munin-node/Makefile Thu Aug 3 13:34:57 2017 (r447210) @@ -3,6 +3,7 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -node @@ -73,6 +74,7 @@ post-patch: @${FIND} ${WRKSRC}/node/sbin -type f -name "*.orig" -delete post-install: + ${REINPLACE_CMD} -i '' -e '1s,${PERL5},${PERL},' ${STAGEDIR}${PREFIX}/bin/munindoc ${MKDIR} ${STAGEDIR}${DBDIR}/plugin-state ${STAGEDIR}${SPOOLDIR}/async ${INSTALL_SCRIPT} ${.CURDIR}/plugins/* ${STAGEDIR}${DATADIR}/plugins/ ${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf \ Modified: head/sysutils/munin-node/files/munin-asyncd.in ============================================================================== --- head/sysutils/munin-node/files/munin-asyncd.in Thu Aug 3 13:29:41 2017 (r447209) +++ head/sysutils/munin-node/files/munin-asyncd.in Thu Aug 3 13:34:57 2017 (r447210) @@ -2,10 +2,12 @@ # # $FreeBSD$ # + # PROVIDE: munin-asyncd # REQUIRE: DAEMON munin-node # BEFORE: cron # KEYWORD: shutdown + # # Add the following lines to /etc/rc.conf to enable munin-asyncd: # munin_asyncd_enable (bool): Set to "NO" by default. @@ -19,17 +21,20 @@ . /etc/rc.subr name=munin_asyncd +desc="munin asynchronous gathering daemon" rcvar=munin_asyncd_enable load_rc_config $name -: ${munin_asyncd_enable:=NO} -: ${munin_asyncd_spool:=%%SPOOLDIR%%/async} -: ${munin_asyncd_host:=localhost:4949} - command="%%DATADIR%%/munin-asyncd" -command_interpreter="%%PREFIX%%/bin/perl" +command_interpreter="%%LOCALBASE%%/bin/perl" pidfile="/var/run/${name}.pid" +start_cmd=start_cmd +stop_cmd='pkill -${sig_stop:-TERM} -U %%USER%% -F ${pidfile}' + +munin_asyncd_enable=${munin_asyncd_enable:-NO} +munin_asyncd_spool=${munin_asyncd_spool:-%%SPOOLDIR%%/async} +munin_asyncd_host=${munin_asyncd_host:-localhost:4949} start_cmd() { Modified: head/sysutils/munin-node/files/munin-node.in ============================================================================== --- head/sysutils/munin-node/files/munin-node.in Thu Aug 3 13:29:41 2017 (r447209) +++ head/sysutils/munin-node/files/munin-node.in Thu Aug 3 13:34:57 2017 (r447210) @@ -2,10 +2,12 @@ # # $FreeBSD$ # + # PROVIDE: munin-node # REQUIRE: DAEMON # BEFORE: cron # KEYWORD: shutdown + # # Add the following lines to /etc/rc.conf to enable munin-node: # munin_node_enable (bool): Set to "NO" by default. @@ -16,18 +18,19 @@ . /etc/rc.subr name=munin_node +desc="munin node daemon" rcvar=munin_node_enable load_rc_config $name -: ${munin_node_enable:=NO} -: ${munin_node_config="%%PREFIX%%/etc/munin/munin-node.conf"} - command="%%PREFIX%%/sbin/munin-node" -command_interpreter="%%PREFIX%%/bin/perl" +command_interpreter="%%LOCALBASE%%/bin/perl" start_precmd=find_pidfile status_precmd=find_pidfile stop_precmd=find_pidfile + +munin_node_enable=${munin_node_enable:-NO} +munin_node_config=${munin_node_config:-"%%PREFIX%%/etc/munin/munin-node.conf"} find_pidfile() { Modified: head/sysutils/munin-node/files/munin-sched.in ============================================================================== --- head/sysutils/munin-node/files/munin-sched.in Thu Aug 3 13:29:41 2017 (r447209) +++ head/sysutils/munin-node/files/munin-sched.in Thu Aug 3 13:34:57 2017 (r447210) @@ -2,10 +2,12 @@ # # $FreeBSD$ # + # PROVIDE: munin-sched # REQUIRE: DAEMON # BEFORE: cron # KEYWORD: shutdown + # # Add the following lines to /etc/rc.conf to enable munin-sched: # munin_sched_enable (bool): Set to "NO" by default. @@ -16,17 +18,18 @@ . /etc/rc.subr name=munin_sched +desc="munin scheduler daemon" rcvar=munin_sched_enable load_rc_config $name -: ${munin_sched_enable:=NO} -: ${munin_sched_config="%%PREFIX%%/etc/munin/munin-node.conf"} - command="%%PREFIX%%/sbin/munin-sched" start_precmd=find_pidfile status_precmd=find_pidfile stop_precmd=find_pidfile + +munin_sched_enable=${munin_sched_enable:-NO} +munin_sched_config=${munin_sched_config:-"%%PREFIX%%/etc/munin/munin-node.conf"} find_pidfile() {