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 does not return error exit code when connection fails #1285

Closed
janniswarnat opened this issue May 21, 2019 · 1 comment
Closed

Comments

@janniswarnat
Copy link

Hi all,

mosquitto_pub in version 1.4.10 returned exit code 5 when a connection to Mosquitto was not allowed (e.g. after adding allow_anonymous false to mosquitto.conf):

# mosquitto_pub --debug -h mosquitto -t test -m test
Client mosqpub/6-b4743bf10343 sending CONNECT
Client mosqpub/6-b4743bf10343 received CONNACK
Connection Refused: not authorised.
Error: The connection was refused.
# echo $?
5

In version 1.6.2 mosquitto_pub returns exit code 0 in the same case:

# mosquitto_pub --debug -h mosquitto -t test -m test
Client mosq/sFqMxtgqkw9lpHaaCn sending CONNECT
Client mosq/sFqMxtgqkw9lpHaaCn received CONNACK (5)
Connection Refused: not authorised.
# echo $?
0

Is that a bug or was a deliberate design decision made to change the behaviour? I could not find anything in the mosquitto_pub docs about exit codes.

Thanks in advance for your feedback and best regards

Jannis

@ralight ralight added this to the 1.6.3 milestone May 21, 2019
ralight added a commit that referenced this issue May 21, 2019
@ralight
Copy link
Contributor

ralight commented May 21, 2019

This wasn't deliberate, thanks for reporting it. I've just pushed a change that fixes it and it will be in 1.6.3.

@ralight ralight closed this as completed May 21, 2019
ralight added a commit that referenced this issue Jun 6, 2019
janniswarnat pushed a commit to linksmart/border-gateway that referenced this issue Aug 6, 2019
vankxr pushed a commit to vankxr/mosquitto that referenced this issue Aug 9, 2019
vankxr pushed a commit to vankxr/mosquitto that referenced this issue Aug 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 19, 2019
ralight added a commit that referenced this issue Sep 18, 2019
ralight added a commit that referenced this issue Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants