1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-15 07:56:36 +00:00

net/mosquitto: Fix startup pidfile issue

PR:		254254
Reviewed by:	swills
Approved by:	joe@thrallingpenguin.com (maintainer, earlier version)
This commit is contained in:
Brad Davis 2021-08-08 10:55:44 -06:00
parent 2607150a39
commit baa26eb67c
2 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= mosquitto
PORTVERSION= 2.0.10
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= https://mosquitto.org/files/source/

View File

@ -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"