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 Thu, Oct 17, 2019 at 9:11 AM Peter Rockett <p.rockett@xxxxxxxxxxxxxxx> wrote:

Update: I now have the watchdog working as before. Don't know what went wrong with the broker authentication but I suspect the update threw a wobbly. The one change I did make was to alter the dependency of my daemon that replies to the watchdog message in its systemd .service file from syslog to rsyslog. But I really don't think that is relevant to the broker problem. Reinstalled mosquitto, rebooted and the watchdog now works fine. So the old cycling of the O-N, O-F-F strategy worked :-)

That said, I still cannot see the /var/run/mosquitto.pid file. This is a minor problem for me since my technique of running a round trip of MQTT messages is a far stronger test of whether the broker has broken(!) than merely checking if the pid file has been removed in an orderly termination by the OS.

I note Greg's comment below, but he is on BSD whereas I am on Linux Mint 19.2. Is anybody on the list running Mint 19.2 (Tina) or Ubuntu 18.04 (Bionic) and can see the /var/run/mosquiito.pid file with version 1.6.7?

My only wild speculation is that when the broker tries to open /var/run/mosquiito.pid it hits an 'access denied' error (why? no idea as surely the process should be running as system at that point?) and fails silently. But before I dive into the source code, it would be helpful if somebody could confirm that they see can this pid file on the same Linux distro.

If you have systemd, you should just ignore the concept of a PID file.  It's actually kind of hard to get a PID file working with a secure daemon since the daemon typically needs privileges to write the file that you don't want the daemon to have when it's running.

Luckily, the concept is obsolete, as is the whole concept of dropping privileges, daemonization, etc...  The OS can do the job of running processes and the application writers can just worry about doing what needs to be done with the smallest set of privileges required.

Back to the top