Skip to content
Advertisement

Error: Unable to write pid file Mosquitto v2.0.3

since I updated Mosquitto v2.0.3 on Ubuntu 16.04 the users can’t connect to the broker.

When I tried to run with /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf it threw the following message. 2020-12-22|12:37:02: Error: Unable to write pid file.

I saw some people had the same problem, so I added pid_file /var/run/mosquitto/mosquitto.pid in mosquitto config but the problem did no go away.

I have this in /lib/systemd/system/mosquitto.service:

JavaScript

The mosquitto.conf file is configured as:

JavaScript

When I ran systemctl status mosquitto from the terminal, it showed me the following message…

JavaScript

I don’t know what is happening, could anybody help me with this? Thanks in advance Regards.

Advertisement

Answer

Guys I already found how to solve the issue.

I’ve managed to get it working too. I’ve manually created a directory /var/run/mosquitto with ownership to user mosquitto and then the folder and file were created automatically.

JavaScript

In mosquitto.conf I set

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement