Summary: | net/mosquitto: ignores mosquitto_pidfile set in /etc/rc.conf | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dan Langille <dvl> | ||||
Component: | Individual Port(s) | Assignee: | Craig Leres <leres> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | joe, leres | ||||
Priority: | --- | Flags: | joe:
maintainer-feedback+
|
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Dan Langille
2021-08-27 15:12:47 UTC
The fix is to move "load_rc_config $name" before the variable assignments. Credit to jrm via IRC and eborisch via Twitter for this. [dan@gelt:/usr/local/etc/rc.d] $ diff -ruN mosquitto mosquitto.mine --- mosquitto 2021-08-22 04:34:48.000000000 +0000 +++ mosquitto.mine 2021-08-27 16:45:52.963755000 +0000 @@ -19,6 +19,7 @@ name=mosquitto rcvar=mosquitto_enable +load_rc_config $name mosquitto_enable=${mosquitto_enable:="NO"} mosquitto_config=${mosquitto_config:="/usr/local/etc/mosquitto/mosquitto.conf"} mosquitto_user=${mosquitto_user:="nobody"} @@ -40,5 +41,10 @@ install -o ${mosquitto_user} -m 644 /dev/null ${pidfile} } -load_rc_config $name +echo mosquitto_enable=$mosquitto_enable +echo mosquitto_config=$mosquitto_config +echo mosquitto_user=$mosquitto_user +echo mosquitto_pidfile=$mosquitto_pidfile +echo pidfile=$pidfile + run_rc_command "$1" [dan@gelt:/usr/local/etc/rc.d] $ Created attachment 227488 [details]
fixes assignment of /etc/rc.conf variables
Credit to jrm for this script. Tested on my hosts.
NOTE: when setting mosquitto_pidfile in /etc/rc.conf, you must also set pid_file (note the underscore) to the same value within the mosquitto configuration file.
Joe: I take it we have maintainer approval to proceed? Just to be explicit. Thank you. Yes, the changes seem very reasonable. -Joe A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=921e007cc543520bac1adf9e96de9483cb3e725e commit 921e007cc543520bac1adf9e96de9483cb3e725e Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2021-08-27 21:35:40 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2021-08-27 21:55:16 +0000 net/mosquitto: update rc.d script to fix mosquitto_pidfile override The default variables were being set before load_rc_config was invoked. jrm@FreeBSD.org did most of this work and all credit goes to him. I only found the problem. He helped tremendously. PR: 258089 Reported by: dvl Approved by: joe@thrallingpenguin.com (maintainer) Obtained from: jrm net/mosquitto/Makefile | 2 +- net/mosquitto/files/mosquitto.in | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) Thank you both. |