You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you enable a listener on a privileged port (like port 80) and set the log_dest file to be a path where the user doesn't have write permissions mosquitto will silently fail. There is no output anywhere (logfile, stdout, stderr, etc) and the return code is 1. This looks to be because it only outputs to the log file if that's the only log_dest that's set.
An easy reproduce is create a mosquitto.conf with:
log_dest file /var/log/mosquitto
listener 80
and then run:
sudo mosquitto -c mosquitto.conf
an strace will show the error is an EACCES on the bind:
but it works fine if you have write access to the file, like if change /var/log/mosquitto to /tmp/mosquitto.
I believe what is happening is that mosquitto is trying to write an error messages to the log file but doesn't have permission to write it and just exits. We probably should add a failback in this case and make sure we dump the errors to stderr (or stdout) if we fail to start and can't write to the log file.
The text was updated successfully, but these errors were encountered:
If you enable a listener on a privileged port (like port 80) and set the log_dest file to be a path where the user doesn't have write permissions mosquitto will silently fail. There is no output anywhere (logfile, stdout, stderr, etc) and the return code is 1. This looks to be because it only outputs to the log file if that's the only log_dest that's set.
An easy reproduce is create a mosquitto.conf with:
log_dest file /var/log/mosquitto
listener 80
and then run:
sudo mosquitto -c mosquitto.conf
an strace will show the error is an EACCES on the bind:
bind(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EACCES (Permission denied)
but it works fine if you have write access to the file, like if change /var/log/mosquitto to /tmp/mosquitto.
I believe what is happening is that mosquitto is trying to write an error messages to the log file but doesn't have permission to write it and just exits. We probably should add a failback in this case and make sure we dump the errors to stderr (or stdout) if we fail to start and can't write to the log file.
The text was updated successfully, but these errors were encountered: