Mosquitto: Mosquitto sometime automatically stop ....!!!!

Created on 5 Aug 2017  路  11Comments  路  Source: eclipse/mosquitto

hello....Friends
Today one of the major problem is staving
mosquitto install on ubuntu16.04 but some time stop mosquitto automatically ????

and after disconnect the mosquitto how to set automatically auto connect??

Can you help me how to track the what reason throw stop the mosquitto.

Thanks in Advance :)

mosquitto-broker need-more-information

All 11 comments

Hello,
In your mosquitto.conf :
add :

log_dest file /home/mosquitto/mosquitto.log
log_type all

With this, you have a chance/lucky to find the problem of stop mosquitto broker ;)

Which version of mosquitto are you using, and where did you get it from?

already added in mosquitto.conf file this two line

log_dest file /home/mosquitto/mosquitto.log
log_type all

Version 1.4.14 currently get the https://mosquitto.org/ website

Thanks!!!!...

Could you please give the few last line of logs before your Mosquitto stop ?

here just we get the status about the mosquitto

write this command

sudo systemctl status mosquitto.service

mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto; bad; vendor preset: enabled)
Active: active (exited) since Mon 2018-01-08 11:58:40 UTC; 13s ago
Docs: man:systemd-sysv-generator(8)
Process: 52984 ExecStop=/etc/init.d/mosquitto stop (code=exited, status=0/SUCCESS)
Process: 52993 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)

Jan 08 11:58:40 DemoServer systemd[1]: Stopped LSB: mosquitto MQTT v3.1 message
Jan 08 11:58:40 DemoServer systemd[1]: Starting LSB: mosquitto MQTT v3.1 message
Jan 08 11:58:40 DemoServer mosquitto[1814]: * Starting network daemon: mosquitt
Jan 08 11:58:40 DemoServer mosquitto[1814]: ...done.
Jan 08 11:58:40 DemoServer systemd[1]: Started LSB: mosquitto MQTT v3.1 message
lines 1-12/12 (END)

why mosquitto server is stop automatically ???

Active: active (exited) since Tue 2018-04-03 04:59:29 UTC; 7h ago

Thanks!!!....

Could you show your reproducing procedure from installing mosquitto-broker on a clean Ubuntu? I cannot reproduce your issue.

On ubuntu 18.04 I install mosquitto using apt-get install mosquitto and ran into a similar issue. It turned out the process was unable to write to the logfile. I discovered this because I wanted to tail -f the logfile as I was starting mosquitto to determine what was going on. It turned out I did not have the permission to read the file.

$ ls -l /var/log/mosquitto/mosquitto.log 
-rw------- 1 114 118 68209 Aug 30 21:48 /var/log/mosquitto/mosquitto.log

also notice the unusual owner and groups.

I did a chmod a+rw on this file, which allowed me to run mosquitto as a systemd service.
I am still unable to run mosquitto as a daemon from the command line. Not sure how to solve that.

hope this helps.

Wierd. I have a similar problem since some time.

I'm running my mosquitto installation (via apt) since long time (on armbian) with auto start (systemctl).
Since some time it doesn't come up anymore. Getting it started (as root) with 'mosquitto -d' still works.

As mentioned by @marcwagner I also checked my logfile and see what: it's also empty!

# ls -l
total 0
-rw-r--r-- 1 root root 0 Nov 16 18:30 mosquitto.log

EDIT: Looks like doing a "chmod a+rw" on the file does work it out (looks like normal now after a system reboot). Thank's to @marcwagner for pointing me there! :+1:

for me the same, thanks for the hint.
I had to create the directory and file under /var/log

Even I am facing the same issue.
Build - Yocto Linux 2.4
Broker - Mosquitto 1.5.8

@vishuPPatel : How did you resolve this issue ?

@toast-uz @ralight @fcarlier @PierreF : Please suggest a work around.

Was this page helpful?
0 / 5 - 0 ratings