Mosquito fails to start

Hi all
Hoping you can help. I’ve installed several bits of software but one of the main ones I want is Mosquito. I don’t have a lot of Linux experience and have spent a lot of time googling this to no avail.

Here is as much information as I can find to give you:

RPi 3 Model B (armv7l)

[ OK ] DietPi-Services | restart : proftpd
[ OK ] DietPi-Services | restart : minidlna
[ OK ] DietPi-Services | restart : squeezelite
[ OK ] DietPi-Services | restart : logitechmediaserver
[ OK ] DietPi-Services | restart : urbackupsrv
[FAILED] DietPi-Services | restart : mosquitto
[ OK ] DietPi-Services | restart : cron
[ OK ] DietPi-Services | restart : dropbear

──────────────┤ DietPi-Services | File viewer ├─────────────────┐│ ││ ● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker ││ Loaded: loaded (/lib/systemd/system/mosquitto.service; ││ disabled; vendor preset: enabled) ││ Active: failed (Result: exit-code) since Sat 2020-04-04 ││ 06:20:13 BST; 23s ago ││ Docs: man:mosquitto.conf(5) ││ man:mosquitto(8) ││ Process: 4101 ExecStart=/usr/sbin/mosquitto -c ││ /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE) ││ Main PID: 4101 (code=exited, status=1/FAILURE) ││ ││ Apr 04 06:20:13 DietPi systemd[1]: mosquitto.service: Service ││ RestartSec=100ms expired, scheduling restart. ││ Apr 04 06:20:13 DietPi systemd[1]: mosquitto.service: Scheduled ││ restart job, restart counter is at 5. ││ Apr 04 06:20:13 DietPi systemd[1]: Stopped Mosquitto MQTT ││ v3.1/v3.1.1 Broker. ││ Apr 04 06:20:13 DietPi systemd[1]: mosquitto.service: Start ││ request repeated too quickly. ││ Apr 04 06:20:13 DietPi systemd[1]: mosquitto.service: Failed ││ with result ‘exit-code’. ││ Apr 04 06:20:13 DietPi systemd[1]: Failed to start Mosquitto ││ MQTT v3.1/v3.1.1 Broker.

Bug report sent, reference code: 7b524c8a-3799-4d08-b0b8-7cfc02e7e98c

Hi,

Pls can you post output of following

journalctl -u mosquitto.service

This is all I got:

– Logs begin at Sat 2020-04-04 09:53:07 BST, end at Sun 2020-04-05 23:00:15 BST. –
– No entries –

can you try to restart your whole system. Once done pls check mosquitto log file

cat /var/log/mosquitto/mosquitto.log

cat: /var/log/mosquitto/mosquitto.log: No such file or directory

can you try running the following command manual to start mosquitto.

/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Thanks for the help. I get this:

1586180857: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.

pls can you have a look if the log directory is existing

ls -la /var/log/

I can’t see it:

drwxr-xr-t 6 root root 440 Apr 2 04:51 .
drwxr-xr-x 13 root root 4096 Dec 27 23:35 …
-rw-r–r-- 1 root root 0 Apr 2 04:51 alternatives.log
drwxr-xr-x 2 root root 100 Apr 4 06:14 apt
-rw-r----- 1 root adm 340 Apr 6 18:42 auth.log
-rw-rw---- 1 root utmp 0 Apr 6 00:16 btmp
-rw-r----- 1 root adm 38069 Apr 6 18:42 daemon.log
-rw-r----- 1 root adm 0 Apr 6 00:17 debug
-rw-r–r-- 1 root root 0 Mar 31 06:17 dietpi-move_userdata.log
-rw-r–r-- 1 root root 0 Apr 4 06:17 dpkg.log
-rw-r----- 1 root adm 0 Apr 6 00:17 kern.log
-rw-rw-r-- 1 root utmp 292 Apr 6 18:42 lastlog
-rw-r----- 1 root adm 0 Apr 6 00:17 messages
-rw-r–r-- 1 minidlna minidlna 0 Feb 11 23:23 minidlna.log
drwx------ 2 root root 40 Dec 28 08:14 private
drwxr-xr-x 2 root root 100 Apr 2 05:10 proftpd
drwxr-xr-x 2 squeezeboxserver nogroup 100 Apr 3 22:29 squeezeboxserver
-rw-r–r-- 1 root root 0 Feb 11 23:24 squeezelite.log
-rw-r----- 1 root adm 38069 Apr 6 18:42 syslog
-rw-r–r-- 1 urbackup urbackup 0 Apr 6 00:15 urbackup.log
-rw-r----- 1 root adm 0 Dec 28 14:17 user.log
-rw-rw-r-- 1 root utmp 768 Apr 6 18:42 wtmp

Well than you would need to create the missing log folder

mkdir /var/log/mosquitto
chown mosquitto /var/log/mosquitto
chmod 755 /var/log/mosquitto

than try to start mosquitto manuell again

AMAZING! Thank you so much that’s got it running. I just need to work out how to use it.

I have a couple of other things that I can’t get to work in the way I think they should but I will create another thread for those when I get the time.

Thanks again!

Hi,

if questions are related to mosquitto themselves, it might be better to discuss or ask this questions on a mosquitto specific board. Not sure if we have that much mosquitto experts on the DietPi Forum :sunglasses: