Mosquitto cannot write pid file [Unresolvable]

Message
Author
User avatar
TasogareNoOkami
Posts: 179
Joined: Sat Oct 24, 2020 2:32 pm

Mosquitto cannot write pid file [Unresolvable]

#1 Post by TasogareNoOkami »

Trying to install Mosquitto MQTT package

Do not know if I am successful.

Synaptic and Apt reply errors in install.

Code: Select all

Setting up mosquitto (2.0.11-1) ...
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.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u5) ...
Errors were encountered while processing:
 mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)
Online searches do not indicate install issues but rather config issues with systemd services and pid file location permissions.
Cannot find similar installation issues.
Is this a configuration issue only ?
Apt indicates the program is not fully installed.
Removed mosquitto package since it is not working

How do I properly install mosquitto ?
Last edited by TasogareNoOkami on Fri Jan 13, 2023 3:59 pm, edited 1 time in total.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Internet and PC Industry/Gaming RIP 2011

User avatar
Eadwine Rose
Administrator
Posts: 15373
Joined: Wed Jul 12, 2006 2:10 am

Re: Mosquitto cannot write pid file

#2 Post by Eadwine Rose »

QSI as with all help requests, thanks :)
MX-23.6_x64 July 31 2023 * 6.1.0-40amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
TasogareNoOkami
Posts: 179
Joined: Sat Oct 24, 2020 2:32 pm

Re: Mosquitto cannot write pid file

#3 Post by TasogareNoOkami »

Nothing in the Quick System Information relates to my issue.
(Just reviewed it; no mention of mosquitto, pid or related keywords)

This is internal to mosquitto package and its configuration.
I am not the package maintainer and cannot address internal issues.
I do not know how package was scripted or packed for installation.

This is not the MX Help board and did not include the quick system information as noticed on that board.

Web Search indicates configuration issues and hence I used the software/configuration board.
It's just that these errors occur during installation.

I cannot sort out the conflicting issues found online between systemd, mosquitto, pid and configuration files.
Details on mosquittos website and github do not discuss installation issues.

Package is not mx-specific but I do not know if there may be a mx conflict.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Internet and PC Industry/Gaming RIP 2011

User avatar
timkb4cq
Developer
Posts: 3633
Joined: Wed Jul 12, 2006 4:05 pm

Re: Mosquitto cannot write pid file

#4 Post by timkb4cq »

unable to open pidfile '/run/mosquitto/mosquitto.pid' for writing (No such file or directory)
There's your problem. The initscript isn't creating the /run/mosquitto directory before trying to write to it.

Code: Select all

sudo mkdir /run/mosquitto
will allow

Code: Select all

sudo service mosquitto start
to work.

Comparing the initscript in MX-19 to the one in MX-21 the difference is that in MX-19 the PID file was /run/mosquitto.pid (which works because /run is already there) and in MX-21 it's /run/mosquitto/mosquitto.pid which fails because /run/mosquitto/ is not.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

User avatar
TasogareNoOkami
Posts: 179
Joined: Sat Oct 24, 2020 2:32 pm

Re: Mosquitto cannot write pid file

#5 Post by TasogareNoOkami »

So is there an error in the package ?
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Internet and PC Industry/Gaming RIP 2011

User avatar
timkb4cq
Developer
Posts: 3633
Joined: Wed Jul 12, 2006 4:05 pm

Re: Mosquitto cannot write pid file

#6 Post by timkb4cq »

Yes. It was reported to debian back in August 2021 but never fixed.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

User avatar
TasogareNoOkami
Posts: 179
Joined: Sat Oct 24, 2020 2:32 pm

Re: Mosquitto cannot write pid file

#7 Post by TasogareNoOkami »

okay got it.
Unfixed package error.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Internet and PC Industry/Gaming RIP 2011

User avatar
timkb4cq
Developer
Posts: 3633
Joined: Wed Jul 12, 2006 4:05 pm

Re: Mosquitto cannot write pid file [Unresolvable]

#8 Post by timkb4cq »

However it is resolvable, just create the directory.

Code: Select all

sudo mkdir /run/mosquitto
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

User avatar
TasogareNoOkami
Posts: 179
Joined: Sat Oct 24, 2020 2:32 pm

Re: Mosquitto cannot write pid file [Unresolvable]

#9 Post by TasogareNoOkami »

timkb4cq wrote: Fri Jan 13, 2023 4:05 pm However it is resolvable, just create the directory.

Code: Select all

sudo mkdir /run/mosquitto
No, your right.
I meant by my edit that the error is not fixed in the package and thus will be a problem for any attempt to install it.

Until fixed in the package script it is permanently broken.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Internet and PC Industry/Gaming RIP 2011

seasoned_geek
Posts: 29
Joined: Wed Jul 30, 2025 11:53 am

Re: Mosquitto cannot write pid file [Unresolvable]

#10 Post by seasoned_geek »

Original post was January 2023. Today is August 31, 2025. This is __still__ happening. I banged into it. Is this one of those "we have to wait for whoever claims to be the maintainer in Debian to fix" or is the MX Linux team maintaining this package in their repos?

Post Reply

Return to “Software / Configuration”