Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 2021 21:55:32 GMT
From:      Dan Langille <dvl@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 921e007cc543 - main - net/mosquitto: update rc.d script to fix mosquitto_pidfile override
Message-ID:  <202108272155.17RLtW44095085@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dvl:

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(-)

diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile
index a98109f9c046..3eb41683cd24 100644
--- a/net/mosquitto/Makefile
+++ b/net/mosquitto/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	mosquitto
 PORTVERSION=	2.0.10
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	https://mosquitto.org/files/source/
 
diff --git a/net/mosquitto/files/mosquitto.in b/net/mosquitto/files/mosquitto.in
index ae1bd703ecbc..6739272ff147 100644
--- a/net/mosquitto/files/mosquitto.in
+++ b/net/mosquitto/files/mosquitto.in
@@ -19,6 +19,8 @@
 name=mosquitto
 rcvar=mosquitto_enable
 
+load_rc_config $name
+
 mosquitto_enable=${mosquitto_enable:="NO"}
 mosquitto_config=${mosquitto_config:="%%PREFIX%%/etc/mosquitto/mosquitto.conf"}
 mosquitto_user=${mosquitto_user:="nobody"}
@@ -28,17 +30,8 @@ command_args="-c ${mosquitto_config} -d"
 pidfile=${mosquitto_pidfile:-"/var/run/mosquitto.pid"}
 required_files=${mosquitto_config}
 
-extra_commands="reload"
-stop_postcmd=stop_postcmd
-stop_postcmd()
-{
-  rm -f $pidfile
-}
-start_precmd=start_precmd
-start_precmd()
-{
-	install -o ${mosquitto_user} -m 644 /dev/null ${pidfile}
-}
+extra_commands=reload
+stop_postcmd="rm -f $pidfile"
+start_precmd="install -o ${mosquitto_user} -m 644 /dev/null ${pidfile}"
 
-load_rc_config $name
 run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108272155.17RLtW44095085>