diff options
author | mat <mat@FreeBSD.org> | 2017-08-03 21:34:57 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2017-08-03 21:34:57 +0800 |
commit | 4c29231ed1dcb9e6c67e20bbac8ac07df7b1ac29 (patch) | |
tree | 7e43dad0073a7849950dc70c430196bba15c8a6d /sysutils | |
parent | 2a97eb51c713eddc5542e6514131cac8a614cb36 (diff) | |
download | freebsd-ports-gnome-4c29231ed1dcb9e6c67e20bbac8ac07df7b1ac29.tar.gz freebsd-ports-gnome-4c29231ed1dcb9e6c67e20bbac8ac07df7b1ac29.tar.zst freebsd-ports-gnome-4c29231ed1dcb9e6c67e20bbac8ac07df7b1ac29.zip |
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
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/munin-node/Makefile | 2 | ||||
-rw-r--r-- | sysutils/munin-node/files/munin-asyncd.in | 15 | ||||
-rw-r--r-- | sysutils/munin-node/files/munin-node.in | 11 | ||||
-rw-r--r-- | sysutils/munin-node/files/munin-sched.in | 9 |
4 files changed, 25 insertions, 12 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 6dcd734b54fb..484aa5bcfb95 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -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 \ diff --git a/sysutils/munin-node/files/munin-asyncd.in b/sysutils/munin-node/files/munin-asyncd.in index f21878cee67e..a9eb2e95f258 100644 --- a/sysutils/munin-node/files/munin-asyncd.in +++ b/sysutils/munin-node/files/munin-asyncd.in @@ -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() { diff --git a/sysutils/munin-node/files/munin-node.in b/sysutils/munin-node/files/munin-node.in index 9784e3176fb2..90e9142ebbc0 100644 --- a/sysutils/munin-node/files/munin-node.in +++ b/sysutils/munin-node/files/munin-node.in @@ -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,19 +18,20 @@ . /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 diff --git a/sysutils/munin-node/files/munin-sched.in b/sysutils/munin-node/files/munin-sched.in index 45e76b661043..2803b11c1532 100644 --- a/sysutils/munin-node/files/munin-sched.in +++ b/sysutils/munin-node/files/munin-sched.in @@ -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,18 +18,19 @@ . /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 |