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 init.d config issue with log_type and port #15506

Closed
colinw-smartrg opened this issue Apr 24, 2021 · 2 comments
Closed

mosquitto init.d config issue with log_type and port #15506

colinw-smartrg opened this issue Apr 24, 2021 · 2 comments
Assignees
Labels
To-Do Maintainer is aware of the issue/PR and will look at it soon.

Comments

@colinw-smartrg
Copy link

colinw-smartrg commented Apr 24, 2021

Maintainer: @karlp
Environment: x86, 64, 21.02

Description:
uci config file conversion issues in the main mosquitto.mosquitto seciton.

log_type is wrongly converted to log_dest
This breaks mosquitto running.

port is deprecated in mosquitto config, but is not optional in the uci config.
It is recommended to use a listener block instead.
In some cases having port in the config will cause mosquitto to not start due to binding issues.

My local fixes for these issues:

diff --git a/net/mosquitto/files/etc/init.d/mosquitto b/net/mosquitto/files/etc/init.d/mosquitto
index b42fa88..603b988 100755
--- a/net/mosquitto/files/etc/init.d/mosquitto
+++ b/net/mosquitto/files/etc/init.d/mosquitto
@@ -63,8 +63,7 @@ convert_mosq_general() {
                echo "bind_address localhost" >> $TCONF
        fi
 
-       config_get port "$1" port 1883
-       echo "port $port" >> $TCONF
+       append_if "$1" port
        append_if "$1" acl_file
        append_optional_bool "$1" allow_anonymous
        append_optional_bool "$1" allow_duplicate_messages
@@ -75,7 +74,7 @@ convert_mosq_general() {
        append_optional_bool "$1" log_timestamp
        config_get log_types "$1" log_types
        for log_type in $log_types; do
-               echo "log_dest $log_type" >> $TCONF
+               echo "log_type $log_type" >> $TCONF
        done
        append_if "$1" max_inflight_bytes
        append_if "$1" max_inflight_messages

@karlp karlp self-assigned this Apr 24, 2021
@karlp karlp added the To-Do Maintainer is aware of the issue/PR and will look at it soon. label Apr 24, 2021
@karlp
Copy link
Contributor

karlp commented Apr 24, 2021

Looks good, will take care of this monday

karlp added a commit that referenced this issue Apr 26, 2021
As pointed out in #15506

The remainder of that patch isn't appropriate for 1907 however.

Signed-off-by: Karl Palsson <karlp@etactica.com>
karlp added a commit that referenced this issue Apr 26, 2021
As reported in: #15506

Signed-off-by: Karl Palsson <karlp@etactica.com>
karlp added a commit that referenced this issue Apr 26, 2021
From mosquitto 2.x, port became optional and deprecated in the config,
and it was recommended that listeners be used instead.  Drop the hard
requirement in our config conversion script.

Reported in: #15506
Signed-off-by: <karlp@etactica.com>
karlp added a commit that referenced this issue Apr 26, 2021
As reported in: #15506

Signed-off-by: Karl Palsson <karlp@etactica.com>
karlp added a commit that referenced this issue Apr 26, 2021
From mosquitto 2.x, port became optional and deprecated in the config,
and it was recommended that listeners be used instead.  Drop the hard
requirement in our config conversion script.

Reported in: #15506
Signed-off-by: <karlp@etactica.com>
@karlp
Copy link
Contributor

karlp commented Apr 26, 2021

Thanks for this, it's now applied to 1907 (log type only) and 2102 and master (both port and log type)

@karlp karlp closed this as completed Apr 26, 2021
codingdie pushed a commit to codingdie/packages that referenced this issue Oct 1, 2022
As pointed out in openwrt#15506

The remainder of that patch isn't appropriate for 1907 however.

Signed-off-by: Karl Palsson <karlp@etactica.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To-Do Maintainer is aware of the issue/PR and will look at it soon.
Projects
None yet
Development

No branches or pull requests

2 participants