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_pub -l doesn't handle server failures #1152

dustin opened this issue Feb 10, 2019 · 3 comments


None yet
2 participants
Copy link

commented Feb 10, 2019

I've got a shell script that's spitting out a number periodically into mosquitto_pub -t something -q 2 -l and have found that any server failures (e.g., restarting the server) is seemingly ignored. The program continues to run, but never sends data to the MQTT broker again.

I'd prefer one of:

  1. reconnect
  2. just exit with a failure

This comment has been minimized.

Copy link

commented Feb 10, 2019

Work for me with a quick test. I'll do more tests, but for the moment which version are you using and on what platform?


This comment has been minimized.

Copy link

commented Feb 10, 2019

mosquitto_pub version 1.5.6 running on libmosquitto 1.5.6.

$ cat /etc/debian_version

$ uname -a
Linux eve 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux

I've got the following script running persistently. I noticed I had not got any data since around the time I restarted to debug something else last night. The script and its constituent parts were still running, but no data showed up in mqtt until I restarted it.

#!/bin/sh -e

sample() {
    while : 
            echo 'select count(*) from spool' | sqlite3 $HOME/influx.spool
            sleep 60

sample | mosquitto_pub --will-topic errors --will-payload 'sj spool reporter discod' \
                       -q 2 -t 'sj/influxer/spool' -l

@ralight ralight added this to the 1.6.3 milestone May 29, 2019


This comment has been minimized.

Copy link

commented May 29, 2019

I've pushed a change which fixes this, if you want to give it a try it is on the fixes branch. Thanks for the report, this will be part of 1.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.