I am using DietPi v7.8.2 on my RPi B (armv6l) and trying to install Mosquitto alongside Node-RED and the Pi-hole. The installation of Mosquitto ran successfully, however the service cannot be started. I already tried to reinstall mosquitto with dietpi-software reinstall 123. The installation worked again, but the service still does not start.
After that I tried to follow the steps from this thread: https://dietpi.com/forum/t/mosquito-fails-to-start/3975/1
Here are the outputs of the commands:
Status of the mosquitto service
root@rpi-smarthome:~# dietpi-services status mosquitto
DietPi-Services
─────────────────────────────────────────────────────
Mode: status mosquitto
[FAILED] DietPi-Services | ● mosquitto.service - Mosquitto MQTT Broker (DietPi)
Loaded: loaded (/etc/systemd/system/mosquitto.service; disabled; vendor preset: enabled)
Active: failed (Result: signal) since Tue 2021-11-30 12:42:46 GMT; 36s ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 389 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=killed, signal=ILL)
Main PID: 389 (code=killed, signal=ILL)
CPU: 83ms
Nov 30 12:42:46 rpi-smarthome systemd[1]: Starting Mosquitto MQTT Broker (DietPi)...
Nov 30 12:42:46 rpi-smarthome systemd[1]: mosquitto.service: Main process exited, code=killed, status=4/ILL
Nov 30 12:42:46 rpi-smarthome systemd[1]: mosquitto.service: Failed with result 'signal'.
Nov 30 12:42:46 rpi-smarthome systemd[1]: Failed to start Mosquitto MQTT Broker (DietPi).
Show service journal
root@rpi-smarthome:~# journalctl -u mosquitto.service
-- Journal begins at Tue 2021-11-30 12:42:22 GMT, ends at Tue 2021-11-30 12:44:30 GMT. --
Nov 30 12:42:46 rpi-smarthome systemd[1]: Starting Mosquitto MQTT Broker (DietPi)...
Nov 30 12:42:46 rpi-smarthome systemd[1]: mosquitto.service: Main process exited, code=killed, status=4/ILL
Nov 30 12:42:46 rpi-smarthome systemd[1]: mosquitto.service: Failed with result 'signal'.
Nov 30 12:42:46 rpi-smarthome systemd[1]: Failed to start Mosquitto MQTT Broker (DietPi).
Show mosquitto logs
root@rpi-smarthome:~# cat /var/log/mosquitto/mosquitto.log
cat: /var/log/mosquitto/mosquitto.log: No such file or directory
Manually restart Mosquitto
root@rpi-smarthome:~# /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Illegal instruction
Show log folder
root@rpi-smarthome:~# ls -la /var/log/
total 32
drwxr-xr-x 6 root root 300 Nov 30 12:36 .
drwxr-xr-x 12 root root 4096 Nov 28 12:36 ..
-rw-r--r-- 1 root root 208 Nov 30 12:42 alternatives.log
drwxr-xr-x 2 root root 100 Nov 30 12:12 apt
-rw-rw---- 1 root utmp 0 Nov 30 12:42 btmp
-rw-r--r-- 1 root root 0 Nov 30 12:13 dpkg.log
-rw-rw-r-- 1 root utmp 292 Nov 30 12:42 lastlog
drwxr-x--- 2 www-data www-data 60 Nov 28 12:52 lighttpd
drwxr-xr-x 2 mosquitto root 40 Nov 30 12:36 mosquitto
-rw------- 1 root root 185 Nov 30 12:42 php7.4-fpm.log
-rw-r--r-- 1 pihole pihole 5980 Nov 30 12:42 pihole-FTL.log
-rw-r--r-- 1 pihole pihole 1121 Nov 30 12:42 pihole.log
-rw-r--r-- 1 pihole pihole 0 Nov 29 00:00 pihole.log.1
drwx------ 2 root root 40 Nov 21 14:17 private
-rw-rw-r-- 1 root utmp 1920 Nov 30 12:42 wtmp
Show (empty) mosquitto log folder:
root@rpi-smarthome:~# ls -la /var/log/mosquitto/
total 0
drwxr-xr-x 2 mosquitto root 40 Nov 30 12:36 .
drwxr-xr-x 6 root root 300 Nov 30 12:36 ..
I created the mosquitto log folder by myself after not finding it using:
mkdir /var/log/mosquitto
chown mosquitto /var/log/mosquitto
chmod 755 /var/log/mosquitto