aboutsummaryrefslogtreecommitdiff
path: root/sysutils/munin-node
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2016-07-19 13:29:03 +0000
committerMathieu Arnold <mat@FreeBSD.org>2016-07-19 13:29:03 +0000
commited31947b52392bc8c9d29c972eafc8ece06f12eb (patch)
tree2c7d84b2f4f624b9773f33226ecc30590cd80e92 /sysutils/munin-node
parent47669f5780e0a51b93fbaa09c6f17077d21c4cea (diff)
downloadports-ed31947b52392bc8c9d29c972eafc8ece06f12eb.tar.gz
ports-ed31947b52392bc8c9d29c972eafc8ece06f12eb.zip
Notes
Diffstat (limited to 'sysutils/munin-node')
-rw-r--r--sysutils/munin-node/Makefile12
-rw-r--r--sysutils/munin-node/files/munin-asyncd.in40
-rw-r--r--sysutils/munin-node/pkg-plist4
3 files changed, 49 insertions, 7 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
index 38cc4594f163..75cb99d4eb96 100644
--- a/sysutils/munin-node/Makefile
+++ b/sysutils/munin-node/Makefile
@@ -3,7 +3,7 @@
PORTNAME= munin
PORTVERSION= ${MUNIN_VERSION}
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils perl5
MASTER_SITES= ${MUNIN_SITES}
PKGNAMESUFFIX= -node
@@ -32,8 +32,8 @@ SHEBANG_FILES= node/sbin/munin-node node/sbin/munin-sched \
.include "${.CURDIR}/../munin-common/munin.mk"
-ALL_TARGET= build-node build-plugins
-INSTALL_TARGET= install-node-prime install-plugins-prime
+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 JAVA
@@ -55,7 +55,7 @@ JAVA_BUILD= yes
JAVA_RUN= yes
SUB_FILES= pkg-message plugins.conf
-USE_RC_SUBR= munin-node munin-sched
+USE_RC_SUBR= munin-asyncd munin-node munin-sched
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
@@ -72,9 +72,7 @@ post-patch:
@${FIND} ${WRKSRC}/node/sbin -type f -name "*.orig" -delete
post-install:
- ${MKDIR} ${STAGEDIR}${DBDIR}/plugin-state
- ${INSTALL_SCRIPT} ${WRKDIR}/munin-node \
- ${STAGEDIR}${PREFIX}/etc/rc.d/munin-node
+ ${MKDIR} ${STAGEDIR}${DBDIR}/plugin-state ${STAGEDIR}${SPOOLDIR}/async
${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf \
${STAGEDIR}${ETCDIR}/munin-node.conf.sample
${INSTALL_DATA} ${WRKDIR}/plugins.conf \
diff --git a/sysutils/munin-node/files/munin-asyncd.in b/sysutils/munin-node/files/munin-asyncd.in
new file mode 100644
index 000000000000..f21878cee67e
--- /dev/null
+++ b/sysutils/munin-node/files/munin-asyncd.in
@@ -0,0 +1,40 @@
+#!/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
+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"
+pidfile="/var/run/${name}.pid"
+
+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
diff --git a/sysutils/munin-node/pkg-plist b/sysutils/munin-node/pkg-plist
index 838f50c2b0a0..6f755c8ce0c3 100644
--- a/sysutils/munin-node/pkg-plist
+++ b/sysutils/munin-node/pkg-plist
@@ -50,6 +50,8 @@ sbin/munin-node
sbin/munin-node-configure
sbin/munin-run
sbin/munin-sched
+%%DATADIR%%/munin-async
+%%DATADIR%%/munin-asyncd
%%JAVA%%%%DATADIR%%/munin-jmx-plugins.jar
%%DATADIR%%/plugins/amavis
%%DATADIR%%/plugins/apache_accesses
@@ -251,4 +253,6 @@ sbin/munin-sched
%%DATADIR%%/plugins/zimbra_
@dir(%%USER%%,%%GROUP%%,) %%DBDIRNODE%%/plugin-state
@dir %%ETCDIR%%/plugins
+@dir(%%USER%%,%%GROUP%%,) %%SPOOLDIR%%/async
+@comment @dir %%SPOOLDIR%%
@comment @dir %%DBDIRNODE%%