Since the update to mosquitto 2.x I've a lot of trouble to get it started at boot with systemd.
With the 1.6.x release I enabled the pid_file option in /etc/mosquitto/mosquitto.conf and set it to /var/run/mosquitto.pid, as recommend in the documentation of this option. In addtion, I enabled the option user and set it to mosquitto.
This does no longer work for mosquitto 2.x. With the first 2.x release, I got always permission errors, the pid file could not be created. After disabling the pid_file option mosquitto started again with systemd.
But after the latest update, I cannot start mosquitto anymore. There are three different paths mentioned for the pid file:
/run/mosquitto.pid for PIDFile in /etc/systemd/system/multi-user.target.wants/mosquitto.service
/var/run/mosquitto.pid for ExecStartPre in /etc/systemd/system/multi-user.target.wants/mosquitto.service
/var/run/mosquitto/mosquitto.pid for pid_file in /etc/mosquitto/mosquitto.conf
But in the end, I can set all three options to any value, systemd always shows me the error that mosquitto could not be started because the pid file /run/mosquitto.pid could not be created.
			
		