From owner-freebsd-ports@freebsd.org Mon Mar 22 13:50:30 2021 Return-Path: Delivered-To: freebsd-ports@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 23B235AF4CA for ; Mon, 22 Mar 2021 13:50:30 +0000 (UTC) (envelope-from dan@langille.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4F3wqm6DgKz3RHT for ; Mon, 22 Mar 2021 13:50:28 +0000 (UTC) (envelope-from dan@langille.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DE5A45C01C2; Mon, 22 Mar 2021 09:50:27 -0400 (EDT) Received: from imap36 ([10.202.2.86]) by compute4.internal (MEProxy); Mon, 22 Mar 2021 09:50:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=langille.org; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=S2On70iFDYQt5FRXQ5e3Fy96B30X69Y 5Q7epHJVfxHg=; b=hI7W17OD97mjkqeZS+wXbaNnUBPr/9QQVdUg2ldH5T1XcN+ H5W1cW1vwzYMwKc2BpfvhUtjRNJY4ZIaX21dfxAtzUZFR5DNgKM8ztuPFZjR4lAZ XEpV1adozn/MdRxYT43qV++uDMhpXshhQ/gtAnQWaxNas6wtx3Ij3OXBzyQJlpKT 2nHRy3WagvRSChIDMunHKgpNjIl71yMN1zeavBF1X/WtMC8LT2/bcYQ7vABJ0gYh xXNcEDjrxXDCn01Lvd2tAtRIw9c51ZWBDLKKlzhE+PMyQW2t4jq4HC/i1cb1IMWa JPjxaUortgzhbaSte3mZDUVeRigUAdHty5RBHew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=S2On70 iFDYQt5FRXQ5e3Fy96B30X69Y5Q7epHJVfxHg=; b=woiloG8l//1A8NGkbuZ1UN Noh8UgBaj5NmAl73DKsjHBHrspvzq2k48gp0hhy8Zi58B/lTUnRleuLRmKh4Vg6t O/C/3HL9ku9buLy37fS+vhP8bLFQKO1WBDzMGZ5Kt1SC+oi232S/PRtEjoQyHr9j lvQQkIwoP/VonfRsin6Nd1vIrQE9hAfusAVreNyUO9yk71YtOCGAx8Mkj3hyHSIk p4GJP8auXLMoFjtZp6sOmQ5XPDb4W9zrh2P37PFBX8NWLmqOJPhmKaUn6Ul39+TP 5FLM2weYlvMp1THgpBpWzMnLOzop0VW0rNPVo8ToHdhMurOK0p7SyIoDPUqdCoCw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeggedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfffgrnhcunfgrnhhgihhllhgvfdcuoegurghnsehlrghn ghhilhhlvgdrohhrgheqnecuggftrfgrthhtvghrnhepvdfgteffvefhveehieetjeffud euueffjeeuteekleehteeljeeljeejtefhgfejnecuffhomhgrihhnpehfrhgvvggsshgu rdhorhhgpdhmohhsqhhuihhtthhordhorhhgpdgvgigrmhhplhgvrdhorhhgnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrnheslhgrnhhg ihhllhgvrdhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5AC4610E007E; Mon, 22 Mar 2021 09:50:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-271-g88286cf463-fm-20210318.001-g88286cf4 Mime-Version: 1.0 Message-Id: <21204ea5-091a-48bc-bdd4-8e0203215d79@www.fastmail.com> In-Reply-To: <8A3FBDC9-B1F2-41F2-B3EF-187E53AF9F85@langille.org> References: <8A3FBDC9-B1F2-41F2-B3EF-187E53AF9F85@langille.org> Date: Mon, 22 Mar 2021 09:50:06 -0400 From: "Dan Langille" To: joe@thrallingpenguin.com Cc: freebsd-ports Subject: Re: FreeBSD Port: net/mosquitto pidfile or pid_file Content-Type: text/plain X-Rspamd-Queue-Id: 4F3wqm6DgKz3RHT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=langille.org header.s=fm3 header.b=hI7W17OD; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=woiloG8l; dmarc=pass (policy=none) header.from=langille.org; spf=pass (mx1.freebsd.org: domain of dan@langille.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=dan@langille.org X-Spamd-Result: default: False [-3.09 / 15.00]; XM_UA_NO_VERSION(0.01)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.26:from]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[langille.org:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[langille.org,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.26:from]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.111.4.26:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[langille.org:s=fm3,messagingengine.com:s=fm2]; FREEFALL_USER(0.00)[dan]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[66.111.4.26:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_WWW(0.50)[]; MAILMAN_DEST(0.00)[freebsd-ports] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 13:50:30 -0000 On Fri, Mar 19, 2021, at 4:14 PM, Dan Langille wrote: > Joe, > > I updated my mosquitto a few days ago and today it was restarted, but > won't start. I think it's related to the update. > > Mar 14 01:47:40 supernews pkg[40249]: mosquitto upgraded: 1.6.7_1 -> 2.0.8 > > The rc.d sript for net/mosquitto greps for pidfile. > > re: > https://svnweb.freebsd.org/ports/head/net/mosquitto/files/mosquitto.in?revision=481153&view=markup#l30 > > The documentation refers to pid_file, not pidfile. > > re: http://mosquitto.org/man/mosquitto-conf-5.html > > I think the rc.d script needs an update. I'd help with a patch, but I > can't get a working solution. > > $ grep pid /usr/local/etc/rc.d/mosquitto > pidfile=$(grep pid_file ${mosquitto_config} | awk '{print($2)}') > echo "pidfile = '$pidfile'" > rm -f $pidfile > > $ sudo service mosquitto start > pidfile = '/var/run/mosquitto.pid' > Starting mosquitto. > > $ ps auwwx | grep mos > dan 20215 0.0 0.0 11404 2260 1 S+ 20:12 0:00.00 grep mos > $ > > > > $ sudo /usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf -v > 1616184446: Error: Unable to write pid file. > > $ ls -ld /var/run > drwxr-xr-x 15 root wheel 1024 Mar 19 20:12 /var/run > > $ ls -l /var/run/mosquitto.pid > ls: /var/run/mosquitto.pid: No such file or directory Solved. At least for me. In addition to the rc.d file change: $ sudo mkdir /var/run/mosquitto $ sudo chown mosquitto:mosquitto /var/run/mosquitto Adjust /usr/local/etc/mosquitto/mosquitto.conf to use this new pid file location. Alter passwd file permissions: $ sudo chgrp mosquitto /usr/local/etc/mosquitto/mosquitto.passwd Modify certificate permissions: $ ls -l /us/usr/local/etc/ssl/example.org.key -rw------- 1 root wheel 1675 Apr 11 2018 /usr/local/etc/ssl/example.org.key $ sudo chgrp mosquitto /usr/local/etc/ssl/example.org.key $ sudo chmod g+r /usr/local/etc/ssl/example.org.key $ ls -l /usr/local/etc/ssl/example.org.key -rw-r----- 1 root mosquitto 1675 Apr 11 2018 /usr/local/etc/ssl/example.org.key Why all this? It seems that mosquitto is now dropping privs before writing the PID file and before reading the certificate and password files. Hope this helps -- Dan Langille dan@langille.org