1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

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
This commit is contained in:
Dan Langille 2021-08-27 21:35:40 +00:00
parent c2b9bf3fe6
commit 921e007cc5
2 changed files with 6 additions and 13 deletions

View File

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

View File

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