Having issues with your DietPi installation, or, found a bug? Post it here.
Ian
Posts: 11 Joined: Thu Feb 28, 2019 12:45 pm
Post
by Ian » Thu Feb 28, 2019 12:55 pm
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:
Code: Select all
[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?
MichaIng
Site Admin
Posts: 2510 Joined: Sat Nov 18, 2017 6:21 pm
Post
by MichaIng » Thu Feb 28, 2019 11:01 pm
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
Ian
Posts: 11 Joined: Thu Feb 28, 2019 12:45 pm
Post
by Ian » Fri Mar 01, 2019 8:54 am
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
Ian
Posts: 11 Joined: Thu Feb 28, 2019 12:45 pm
Post
by Ian » Fri Mar 01, 2019 9:10 am
I've just de-installed home-assistant, after reboot all services were dead did a services restart, now mosquito is running
MichaIng
Site Admin
Posts: 2510 Joined: Sat Nov 18, 2017 6:21 pm
Post
by MichaIng » Wed Mar 06, 2019 2:11 am
@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:
Code: Select all
sed -i '/After=/s/[[:blank:]]multi-user.target//' /etc/systemd/system/dietpi-postboot.service
systemctl daemon-reload
systemctl enable dietpi-postboot