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 dies after SIGHUP on Raspberry Pi #849
Comments
Well, it appears that the context with the missing listener was loaded from the database. It wasn't a current context. Maybe it remained from before the update and the context structure has been changed in between or so. Has it? Is there a tool to dump the database and inspect it? |
There is a crude tool if you look in the source tree at |
The problem with it trying to open 1883 listeners is caused by char being unsigned on the Pi, I'm just about to push a fix for that. |
Found via #849. Signed-off-by: Roger A. Light <roger@atchoo.org>
Your other problem I'm not sure about yet. A persistent client that is disconnected will not have a listener set because it isn't connected to the broker. |
I think this should be fixed in the latest |
Found via #849. Signed-off-by: Roger A. Light <roger@atchoo.org>
To start with I am a total noob to Mosquitto. I have been using it for approximately 3 weeks and up until today everything has been working great. I am running pure Mosquitto one broker and three clients. I reboot my raspberry pi's every might. Last night the brokers database got corrupted on the reboot so today when I finally figured out what the issue was I removed the database. Now whenever I try to start the broker I get the following in the log and no other messages.
I have reboot my broker pi with no changes. I am to the point of removing and re-installing unless someone has a solution. Here is a copy of my conf file
|
I've a quite strange behavior on my RPi running Raspian Stretch since the last update a few days ago: mosquitto dies after SIGHUP (happens every morning due to the logrotate script).
I just cloned the repo and built from source and found the same behavior. My configuration is
This configuration opens two listeners, the default listener at port 1883 without tls and without passwords and a second listener at port 8883 with tls and with passwords.
I started debugging on the RPi and inserted some printf's and found that mosquitto died in security_default.c, mosquitto_security_apply_default, line 864 (line 870 in my fork at github.com:wollud1969/mosquitto) since context->listener is null.
The listener is not set.
For easier debugging I switched to my laptop (Debian Stretch), prepared an environment with exactly the same configuration (well, nearly the same: paths for persistence, pwfile, certs and keys are different, content is the same).
But on the laptop I got the following output:
Here, the listener is set.
I found a difference in the evaluation of the configuration between RPi and laptop:
When I try to set a listener statement on the RPi to port 1883
I got in the logfile:
So, appearently it trys to open the default listener on port 1883 and an additional listener on port 1883, which fails.
On the laptop this works, only one listener is opened on port 1883. Actually, when I change the first listener statement on the laptop to port 1884 no listener on port 1883 (default listener) is opened at all.
I'm trying to track this down even more but currently I got lost in all the context and HASH stuff. But maybe someone else has an idea why mosquitto dies on the RPi on a SIGHUP. I'm trying to continue in understanding the internals of mosquitto while tracking down this even closer but so far I want to share this intermediate results with you.
Help would be real appreciated since I'm about to use mosquitto on RPIs at work in an industrial IoT setup and also here I need the coexistance of port 1883 and port 8883 listener, same as in my smarthome environment, were it is currently failing.
The text was updated successfully, but these errors were encountered: