For the past couple days I`ve been trying to solve this issue. Been running on Ubuntu 22.04 and Mosquitto 2.0.11.
my mosquitto.conf file:
pid_file /run/mosquitto/mosquitto.pid
persistence false
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
listener 8883
cafile /etc/mosquitto/certs/ca.crt
certfile /etc/mosquitto/certs/server.crt
keyfile /etc/mosquitto/certs/server.key
require_certificate false
tls_version tlsv1.2
I`ve tried to change the ownership of the folder and change the .pid file to /var/run/mosquitto, but nothing seems to work. I keep getting the unable to write .pid file error.
Could it be a problem with the versions? Or is it something else?
Have you tried writing the file elsewhere (tested with 2.0.11 and it works OK). How did you “change ownership of the folder”? (
/run
is a tmpfs that is created at boot, on Ubuntu at least). This may help.Also explain what you changed and how you are testing this