#1071721 [mosquitto] mosquittostart-stop-daemon: unable to open pidfile '/run/mosquitto/mosquitto.pid' for writing (No such file or directory)

Package:
mosquitto
Source:
mosquitto
Description:
MQTT version 5.0/3.1.1/3.1 compatible message broker
Submitter:
Jean-Marc LACROIX
Date:
2024-12-12 15:03:02 UTC
Severity:
normal
#1071721#5
Date:
2024-05-24 10:23:36 UTC
From:
To:
Is seems that on  package mosquitto (Debian 12.5  Bookworm), is is not
possible to install the package & start the daemon.

Please  note following  example are  done  on amd64  architecture, but
behaviour is the same on others architectures.

This bug is probably due to the directory created with the pid file.

ansible@hn-asusgl752-400:~$ LC_ALL=C dpkg -l |grep mosquitto
ii  libmosquitto1:amd64                      2.0.11-1.2+deb12u1
          amd64        MQTT version 5.0/3.1.1/3.1 client library
ii  mosquitto-clients                        2.0.11-1.2+deb12u1
          amd64        Mosquitto command line MQTT clients
ansible@hn-asusgl752-400:~$

ansible@hn-asusgl752-400:~$ cat /etc/debian_version
12.5


ansible@hn-asusgl752-400:~$ LC_ALL=C apt policy mosquitto
mosquitto:
   Installed: (none)
   Candidate: 2.0.11-1.2+deb12u1
   Version table:
      2.0.18-1+b2 80
          80 http://ftp.de.debian.org/debian trixie/main amd64 Packages
      2.0.11-1.2+deb12u1 500
         500 http://ftp.de.debian.org/debian bookworm/main amd64 Packages
         500 https://security.debian.org bookworm-security/main amd64
Packages
      2.0.11-1+deb11u1 90
          90 http://ftp.de.debian.org/debian bullseye/main amd64 Packages
ansible@hn-asusgl752-400:~$


ansible@hn-asusgl752-400:~$ LC_ALL=C sudo apt install mosquitto -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
   mosquitto
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/409 kB of archives.
After this operation, 1063 kB of additional disk space will be used.
Selecting previously unselected package mosquitto.
(Reading database ... 289805 files and directories currently installed.)
Preparing to unpack .../mosquitto_2.0.11-1.2+deb12u1_amd64.deb ...
Unpacking mosquitto (2.0.11-1.2+deb12u1) ...
Setting up mosquitto (2.0.11-1.2+deb12u1) ...
Starting network daemon:: mosquittostart-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
  failed!
invoke-rc.d: initscript mosquitto, action "start" failed.
dpkg: error processing package mosquitto (--configure):
  installed mosquitto package post-installation script subprocess
returned error exit status 1
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...
Errors were encountered while processing:
  mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)
ansible@hn-asusgl752-400:~$

ansible@hn-asusgl752-400:~ mount |grep /run
tmpfs on /run type tmpfs
(rw,nosuid,nodev,noexec,relatime,size=1165244k,mode=755,inode64)
tmpfs on /run/lock type tmpfs
(rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
tmpfs on /run/user/998 type tmpfs
(rw,nosuid,nodev,relatime,size=1165244k,nr_inodes=291311,mode=700,uid=998,gid=1004,inode64)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
ansible@hn-asusgl752-400:~/git/ansible-jml.git/sources/environments/site_test_local$


It seems that following line can correct launching o daemon

    sed -i -e
's#PIDFILE=/run/mosquitto/mosquitto.pid#PIDFILE=/run/mosquitto.pid#g'
/etc/init.d/mosquitto

Best regards

#1071721#10
Date:
2024-10-10 08:10:39 UTC
From:
To:
control: fixed -1 2.0.17-1

this was reworked, and fixed in sid in commit 403562388f8e0a6b9ee937d6832b039c584153be

#1071721#17
Date:
2024-12-12 14:49:13 UTC
From:
To:
control: close -1
We don't plan to fix stable, feel free to provide a patch and a new bug if you want an update there.
G.

Yahoo Mail: Search, Organize, Conquer