git: baa26eb67c4d - main - net/mosquitto: Fix startup pidfile issue
Brad Davis
brd at FreeBSD.org
Sun Aug 8 16:58:33 UTC 2021
The branch main has been updated by brd (doc, src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=baa26eb67c4d0d6406a190dec9214520a53c02e1
commit baa26eb67c4d0d6406a190dec9214520a53c02e1
Author: Brad Davis <brd at FreeBSD.org>
AuthorDate: 2021-08-08 16:55:44 +0000
Commit: Brad Davis <brd at FreeBSD.org>
CommitDate: 2021-08-08 16:55:44 +0000
net/mosquitto: Fix startup pidfile issue
PR: 254254
Reviewed by: swills
Approved by: joe at thrallingpenguin.com (maintainer, earlier version)
---
net/mosquitto/Makefile | 1 +
net/mosquitto/files/mosquitto.in | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile
index 740405a39144..a98109f9c046 100644
--- a/net/mosquitto/Makefile
+++ b/net/mosquitto/Makefile
@@ -2,6 +2,7 @@
PORTNAME= mosquitto
PORTVERSION= 2.0.10
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= https://mosquitto.org/files/source/
diff --git a/net/mosquitto/files/mosquitto.in b/net/mosquitto/files/mosquitto.in
index f781b772af61..ae1bd703ecbc 100644
--- a/net/mosquitto/files/mosquitto.in
+++ b/net/mosquitto/files/mosquitto.in
@@ -21,10 +21,11 @@ rcvar=mosquitto_enable
mosquitto_enable=${mosquitto_enable:="NO"}
mosquitto_config=${mosquitto_config:="%%PREFIX%%/etc/mosquitto/mosquitto.conf"}
+mosquitto_user=${mosquitto_user:="nobody"}
command=%%PREFIX%%/sbin/mosquitto
command_args="-c ${mosquitto_config} -d"
-pidfile=$(grep pidfile ${mosquitto_config} | awk '{print($2)}')
+pidfile=${mosquitto_pidfile:-"/var/run/mosquitto.pid"}
required_files=${mosquitto_config}
extra_commands="reload"
@@ -33,6 +34,11 @@ stop_postcmd()
{
rm -f $pidfile
}
+start_precmd=start_precmd
+start_precmd()
+{
+ install -o ${mosquitto_user} -m 644 /dev/null ${pidfile}
+}
load_rc_config $name
run_rc_command "$1"
More information about the dev-commits-ports-all
mailing list