Subject: mosquitto: unable to open pidfile for writing - missing directory /run/mosquitto

From: Flavio Stanchina <[email-masked]>
Date: Thu, 28 Oct 2021 22:57:27 +0200

Package: mosquitto
Version: 2.0.11-1
Severity: normal

The init script fails with:

Starting network daemon:: mosquitto
start-stop-daemon: unable to open pidfile '/run/mosquitto/mosquitto.pid' for writing (No such file or directory)
start-stop-daemon: child returned error exit status 2

Apparently, nobody creates directory /run/mosquitto.

Adding the following lines in /etc/init.d/mosquitto solves the problem:
mkdir -m 740 -p /run/mosquitto
chown mosquitto /run/mosquitto

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 4 (chimaera)
Release:	4
Codename:	chimaera
Architecture: x86_64

Kernel: Linux 5.10.0-9-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages mosquitto depends on:
ii  adduser                    3.118
ii  libc6                      2.31-13+deb11u2
ii  libcjson1                  1.7.14-1
ii  libdlt2                    2.18.6-1
ii  libelogind0 [libsystemd0]  246.10-2
ii  libmosquitto1              2.0.11-1
ii  libssl1.1                  1.1.1k-1+deb11u1
ii  libwebsockets16            4.0.20-2
ii  libwrap0                   7.6.q-31
ii  lsb-base                   11.1.0

mosquitto recommends no packages.

Versions of packages mosquitto suggests:
ii  apparmor  2.13.6-10

-- no debconf information

---

From: Mark Hindley <[email-masked]>
Date: Fri, 29 Oct 2021 07:58:20 +0100

Control: tags -1 debian
Control: forwarded -1 https://bugs.debian.org/993048

Flavio,

> The init script fails with:

Thanks for this. However, mosquitto is not a forked package and Devuan uses
Debian's packages directly without recompilation. Indeed, this issue is already
reported in Debian's BTS[1]. Please add your voice there to get it fixed.

Mark

[1]  https://bugs.debian.org/993048