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

gpsd: the deamon accepts multiple devices, the configuration & init script does not. #26004

Closed
asmodehn opened this issue Feb 18, 2025 · 3 comments

Comments

@asmodehn
Copy link

Currently there is only one device that can be managed by gpsd.

With the current config and init script, if you have multiple devices, you will need to have multiple instances of gpsd running.

I can probably contribute a PR with the config and init script modified to accept multiple devices...

@feckert
Copy link
Member

feckert commented Feb 18, 2025

I have recently added the following PR.
Maybe we should add another commit that changes the uci option device to a list device option?

@asmodehn
Copy link
Author

Here are my changes in the init script:

validate_section_gpsd()
{
        uci_load_validate gpsd gpsd "$1" "$2" \
                'enabled:bool:1' \
=>                'devices:list(string)' \
                'listen_globally:bool:0' \
                'port:port:2947'
}

gpsd_instance()
{
        [ "$2" = 0 ] || {
                echo "validation failed"
                return 1
        }

        [ "$enabled" = "0" ] && return 1

        procd_open_instance
        procd_set_param command "$PROG" -N -n

        [ "$listen_globally" -ne 0 ] && procd_append_param command -G
        procd_append_param command -S "$port"
=>        for device in $devices; do
=>                procd_append_param command "$device"
=>        done
        procd_set_param respawn

        procd_close_instance
}

I guess there might be issues with configuration upgrades...? maybe it s better to do this in a PR following yours ?
I m not use to the PR flow here, so feel free to take this and / or let me know how you would prefer to proceed...

@feckert
Copy link
Member

feckert commented Feb 20, 2025

I have added your changes to my pending PR.
I changed it from uci option deivce to uci list devices and also created a uci-defaults script to do the migration for option device to list devices.
Could you please verify if this is working as expected and provide feedback.

@feckert feckert closed this as completed Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants