From owner-dev-commits-ports-main@freebsd.org Sun Aug 8 16:58:33 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78219660125; Sun, 8 Aug 2021 16:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjQQd2jxZz3FSJ; Sun, 8 Aug 2021 16:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4185817F60; Sun, 8 Aug 2021 16:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178GwXd9095131; Sun, 8 Aug 2021 16:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178GwXw0095130; Sun, 8 Aug 2021 16:58:33 GMT (envelope-from git) Date: Sun, 8 Aug 2021 16:58:33 GMT Message-Id: <202108081658.178GwXw0095130@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Brad Davis Subject: git: baa26eb67c4d - main - net/mosquitto: Fix startup pidfile issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: baa26eb67c4d0d6406a190dec9214520a53c02e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 16:58:33 -0000 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 AuthorDate: 2021-08-08 16:55:44 +0000 Commit: Brad Davis CommitDate: 2021-08-08 16:55:44 +0000 net/mosquitto: Fix startup pidfile issue PR: 254254 Reviewed by: swills Approved by: joe@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"