Mosquito.service failing

Hello all,

I’m running a quite fresh install of Dietpi v6.21.1 on a RPi 3 Model B all services are running except for Mosquito the service fails with this error:

[FAILED] DietPi-Services | mosquitto	failed (Result: exit-code) since Thu 2019-02-28 12:30:50 CET; 21s ago
● mosquitto.service - Mosquitto (DietPi)
   Loaded: loaded (/etc/systemd/system/mosquitto.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-02-28 12:30:50 CET; 21s ago
  Process: 6673 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
 Main PID: 6673 (code=exited, status=1/FAILURE)

Feb 28 12:30:50 DietPi systemd[1]: Started Mosquitto (DietPi).
Feb 28 12:30:50 DietPi mosquitto[6673]: 1551353450: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.
Feb 28 12:30:50 DietPi systemd[1]: mosquitto.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 12:30:50 DietPi systemd[1]: mosquitto.service: Unit entered failed state.
Feb 28 12:30:50 DietPi systemd[1]: mosquitto.service: Failed with result 'exit-code'.

Seems like mosquitto.log can’t be written to, could someone help me resolve this please?

Strange, the log dir is included in the Debian APT package and the log file is accordingly auto-created here during quick test.

Could you check dir and file exists and has correct permissions: ls -Al /var/log/mosquitto

I’ve checked and the file exists:

-rw-r–r-- 1 homeassistant mosquitto 0 Feb 19 17:22 mosquitto.log

root@DietPi:~# ls -Al /var/log/mosquitto
total 0
-rw-r–r-- 1 homeassistant mosquitto 0 Feb 19 17:22 mosquitto.log

Does it matter that I’ve installed homeassistant?

If I physically look in /var/log/mosquitto the mosquitto.log is there

I’ve just de-installed home-assistant, after reboot all services were dead did a services restart, now mosquito is running

Ian
Strange that the mosquitto log is owned by homeassistant user?!?? I check if we have some typo inside our permissions script.

Most properly if your services do not start on boot automatically, it is a known issue with our postboot script on v6.20/21, fixed for v6.22. To resolve now:

sed -i '/After=/s/[[:blank:]]multi-user.target//' /etc/systemd/system/dietpi-postboot.service
systemctl daemon-reload
systemctl enable dietpi-postboot