Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Changes in latest version breaks watchdog

On 15/10/2019 17:20, Greg Troxel wrote:
I have had the mosquitto broker running under Linux Mint 19 with a
watchdog daemon without problems for several months. I have just
upgraded to the latest version of mosquitto and immediately got into a
cycle of perpetual reboots.
You did not explain the versions you updated from and to.
From 1.6.4 to 1.6.7(the latest)
The first issue I have run down is that mosquitto no longer seems to
produce a /var/run/mosquitto.pid file, which I thought was pretty
standard for daemons. My watchdog was testing for the existence of
this pid file to check that the broker had not terminated. So Question
1: Has the generation of /var/run/mosquitto.pid been removed from the
latest version? If so, why? If not, any ideas why I am not seeing it?
It is pretty standard, but I hear that some people like systemd which
does things differently, or some other init system.  The pid file can be
configured in the config file.

You also didn't explain how you merged the config file changes between
releases, and if you have diffed your old config file from the old
sample, and the new config file from the new sample, and studied the
content of the diffs and the changes between them.

Neither of the config files have not been changed by the update. This is the behaviour I would expect - I have never seen a case where an update on Linux trashes a user's configuration files. I would regard that as a packaging bug.

In this particular case, my mosquitto.conf file (still) contains the line:

pid_file /var/run/mosquitto.pid

I have reinstalled all the packages, restarted the service and I still cannot see this pid file! :-\


Question 2: Have there been any other changes? (The change log seems
to show only benign bug fixes.) Even when I stop my watchdog checking
for the existence of (a non-existent) /var/run/mosquitto.pid file, I
am still getting unexpected restarts. My setup is that my watchdog
periodically runs an executable that writes via the broker to a
service program that then responds with a message back to the first
executable; all MQTT messages use libmosquitto. If the round trip
works properly then I can infer that all is well; otherwise my testing
program returns an error code to the watchdog that then forces a
restart. On digging a little deeper, the service at the end of the
chain that responds is now unable to connect to the new version of the
broker. Again, this has all worked perfectly for several months but
now appears to have broken on the new version of mosquitto. Any ideas?
Do I need to reset the passwords when I upgrade?

This is really a question for your distribution; mosuqitto doens't
control how the config files are changed during an upgrade process.
As stated above, the conf files have not been changed by the update (as I would expect). But the behaviour of mosquitto has changed!

I suggest making conenctions by hand with mosquitto_{pub,sub} and
watching the logs, and then doing it with your watchdog programs.
Done this. I can still send messages between mosquitto_pub and mosquitto_sub using the same username/password I had before. So the authentication credentials are unchallenged. Puzzling why I am seeing a connection refusal.
Debugging a newly-arrived problem is really the same process as getting
in going in the first place, except you are looking for a change you
didn't expect instead of a mistake you didn't realize you made (or bad
docs that told you to configure something wrong) :-)

Will carry on digging. One option may be to reinstall version 1.6.4 and see if that still works.

P.



Back to the top