Index: head/sysutils/munin-node/Makefile =================================================================== --- head/sysutils/munin-node/Makefile (revision 447209) +++ head/sysutils/munin-node/Makefile (revision 447210) @@ -1,91 +1,93 @@ # Created by: Lupe Christoph # $FreeBSD$ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -node MAINTAINER= mat@FreeBSD.org COMMENT= Node-specific part of Munin BUILD_DEPENDS= p5-Module-Build>=0:devel/p5-Module-Build \ p5-DateTime-HiRes>=0:devel/p5-DateTime-HiRes \ munin-common>=${MUNIN_VERSION}:sysutils/munin-common \ p5-Net-Server>=0:net/p5-Net-Server \ bash:shells/bash RUN_DEPENDS= p5-Cache-Cache>=0:devel/p5-Cache-Cache \ p5-DateTime-HiRes>=0:devel/p5-DateTime-HiRes \ munin-common>=${MUNIN_VERSION}:sysutils/munin-common \ p5-Net-Server>=0:net/p5-Net-Server \ p5-Net-CIDR>=0:net-mgmt/p5-Net-CIDR \ p5-libwww>=0:www/p5-libwww \ bash:shells/bash USES= gmake perl5 shebangfix cpe PKGMESSAGE= ${WRKDIR}/pkg-message REINPLACE_ARGS= -i "" SHEBANG_FILES= node/bin/munindoc node/sbin/munin-node node/sbin/munin-sched \ node/sbin/munin-run node/sbin/munin-node-configure .include "${.CURDIR}/../munin-common/munin.mk" ALL_TARGET= build-node build-plugins build/node/_bin/munin-async build/node/_bin/munin-asyncd INSTALL_TARGET= install-node-prime install-async-prime install-plugins-prime NO_ARCH= yes OPTIONS_DEFINE= SNMP PERL PYTHON JAVA OPTIONS_DEFAULT= SNMP PERL PYTHON OPTIONS_SUB= yes SNMP_DESC= Include SNMP plugins PERL_DESC= Include all Perl modules (adds dependencies) JAVA_DESC= Include JAVA plugins PYTHON_DESC= Include Python plugins SNMP_BUILD_DEPENDS= p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP SNMP_RUN_DEPENDS= p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP PERL_RUN_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg \ p5-Net-DNS>=0:dns/p5-Net-DNS \ p5-XML-Parser>=0:textproc/p5-XML-Parser \ p5-XML-LibXML>=0:textproc/p5-XML-LibXML PYTHON_USES= python JAVA_USE= java=yes JAVA_INSTALL_TARGET= install-plugins-java JAVA_BUILD= yes JAVA_RUN= yes SUB_FILES= pkg-message plugins.conf USE_RC_SUBR= munin-asyncd munin-node munin-sched post-patch: @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ ${WRKSRC}/node/sbin/munin-node \ ${WRKSRC}/node/sbin/munin-node-configure \ ${WRKSRC}/node/sbin/munin-run @${REINPLACE_CMD} \ -e 's|^\(BASH[[:space:]]*:=\).*|\1 ${bash_CMD}|' \ -e 's|^\(JAVARUN[[:space:]]*:=\).*|\1 ${java_CMD}|' \ -e 's|^\(PERL[[:space:]]*:=\).*|\1 ${perl_CMD}|' \ -e 's|^\(PYTHON[[:space:]]*:=\).*|\1 ${python_CMD}|' \ -e 's|^\(RUBY[[:space:]]*:=\).*|\1 ${ruby_CMD}|' \ ${WRKSRC}/Makefile.config @${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 \ ${STAGEDIR}${ETCDIR}/munin-node.conf.sample ${INSTALL_DATA} ${WRKDIR}/plugins.conf \ ${STAGEDIR}${ETCDIR}/plugins.conf.sample (cd ${WRKSRC}/node/blib/bindoc; \ ${INSTALL_MAN} munin-node-configure.1 munin-node.1 munin-run.1 munin-sched.1 munindoc.1 ${STAGEDIR}${MAN1PREFIX}/man/man1; \ ) (cd ${WRKSRC}/build/doc; \ ${INSTALL_MAN} munin-node.conf.5 ${STAGEDIR}${MAN5PREFIX}/man/man5; \ ${INSTALL_MAN} munin.8 ${STAGEDIR}${MAN8PREFIX}/man/man8; \ ) ${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-node.newsyslog .include Index: head/sysutils/munin-node/files/munin-asyncd.in =================================================================== --- head/sysutils/munin-node/files/munin-asyncd.in (revision 447209) +++ head/sysutils/munin-node/files/munin-asyncd.in (revision 447210) @@ -1,40 +1,45 @@ #!/bin/sh # # $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. # Set it to "YES" to enable munin-asyncd # munin_asyncd_spool: The spool directory, default: # %%DBDIR%%/async # munin_asyncd_host: Host to connect to, default: localhost:4949 # munin_asyncd_args: Extra args to pass to munin-asyncd # . /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() { check_startmsgs && echo "Starting ${name}." daemon -u %%USER%% -f -p ${pidfile} ${command_interpreter} ${command} --spool ${munin_asyncd_spool} --host ${munin_asyncd_host} ${munin_asyncd_args} } run_rc_command $1 Index: head/sysutils/munin-node/files/munin-node.in =================================================================== --- head/sysutils/munin-node/files/munin-node.in (revision 447209) +++ head/sysutils/munin-node/files/munin-node.in (revision 447210) @@ -1,38 +1,41 @@ #!/bin/sh # # $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. # Set it to "YES" to enable munin-node # munin_node_config (path): Set to "%%PREFIX%%/etc/munin/munin-node.conf" by default. # . /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() { get_pidfile_from_conf pid_file $munin_node_config pidfile="$_pidfile_from_conf" } run_rc_command $1 Index: head/sysutils/munin-node/files/munin-sched.in =================================================================== --- head/sysutils/munin-node/files/munin-sched.in (revision 447209) +++ head/sysutils/munin-node/files/munin-sched.in (revision 447210) @@ -1,38 +1,41 @@ #!/bin/sh # # $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. # Set it to "YES" to enable munin-sched # munin_sched_config (path): Set to "%%PREFIX%%/etc/munin/munin-node.conf" by default. # . /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() { get_pidfile_from_conf pid_file $munin_sched_config pidfile="${_pidfile_from_conf%node*}sched" pidfile="${pidfile}${_pidfile_from_conf#*node}" } run_rc_command "$1"