Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mosquitto sometime automatically stop ....!!!! #509

Open
vishuPPatel opened this issue Aug 5, 2017 · 12 comments
Open

Mosquitto sometime automatically stop ....!!!! #509

vishuPPatel opened this issue Aug 5, 2017 · 12 comments
Labels
Component: mosquitto-broker Status: Blocked Another issue needs to be resolved first

Comments

@vishuPPatel
Copy link

vishuPPatel commented Aug 5, 2017

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 :)

@fcarlier
Copy link

fcarlier commented Aug 5, 2017

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 ;)

@ralight
Copy link
Contributor

ralight commented Aug 9, 2017

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

@vishuPPatel
Copy link
Author

vishuPPatel commented Aug 10, 2017

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!!!!...

@PierreF
Copy link
Contributor

PierreF commented Jan 5, 2018

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

@PierreF PierreF added the Status: Blocked Another issue needs to be resolved first label Jan 5, 2018
@vishuPPatel
Copy link
Author

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)

@vishuPPatel
Copy link
Author

why mosquitto server is stop automatically ???

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

Thanks!!!....

@toast-uz
Copy link
Contributor

toast-uz commented Apr 3, 2018

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

@ChefsSlaad
Copy link

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.

@rradar
Copy link

rradar commented Nov 22, 2018

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! 👍

@fabian727
Copy link

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

@ghost
Copy link

ghost commented Apr 21, 2020

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.

@gkzsolt
Copy link

gkzsolt commented Mar 12, 2021

Hi mosquitto devs,
Have you succeeded to reproduce the problem? I don't think it is much to reproduce. Installation from apt, mosquitto 1.4.10-3+deb9u4 on a Debian 9 stretch. After a system reboot, the service refuses to start, the log file is 0 length (or having nothing relevant) and systemctl status says

Active: active (exited)

This latter and all these are, I must confess, very annoying.

The problem seems to lie in the log file permissions, since changing /var/log/mosquitto/mosquitto.log to 666 solves the issue. Can somebody, please fix this?

Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: mosquitto-broker Status: Blocked Another issue needs to be resolved first
Projects
None yet
Development

No branches or pull requests

9 participants