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

Force ipv4 in gpsd.socket on Jetson Nano #3901

Merged
merged 3 commits into from
Mar 17, 2022

Conversation

mattdibi
Copy link
Contributor

Disabled gpsd-related services

Description of the solution adopted:

Currently on the Jetson Nano profile systemctl reports a failure with:

jetson@jetson-nano:~$ systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● gpsd.socket loaded failed failed GPS (Global Positioning System) Daemon Sockets
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

because:

jetson@jetson-nano:~$ sudo systemctl status gpsd.socket
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
Loaded: loaded (/lib/systemd/system/gpsd.socket; enabled; vendor preset: enabled)
Active: failed (Result: resources)
Listen: /var/run/gpsd.sock (Stream)
[::1]:2947 (Stream)
127.0.0.1:2947 (Stream)
mar 16 11:56:17 jetson-nano systemd[1]: gpsd.socket: Failed to listen on sockets: Cannot assign requested address
mar 16 11:56:17 jetson-nano systemd[1]: gpsd.socket: Failed with result 'resources'.
mar 16 11:56:17 jetson-nano systemd[1]: Failed to listen on GPS (Global Positioning System) Daemon Sockets.

With this PR we ensure both gpsd.service and gpsd.socket are disabled on Kura installation.

Signed-off-by: Mattia Dal Ben [email protected]

Signed-off-by: Mattia Dal Ben <[email protected]>
@mattdibi mattdibi changed the title Disabled gpsd-related services Disabled gpsd-related services on Jetson Nano Mar 16, 2022
@MMaiero
Copy link
Contributor

MMaiero commented Mar 16, 2022

Maybe try to change the service definition to enable only ipv4, disabling ipv6. Maybe this solves

@mattdibi
Copy link
Contributor Author

@MMaiero Updated installer with

#force gpsd.socket to use only ipv4
sed -i "s/\(ListenStream=\[::1\]\)/# \1/g" /lib/systemd/system/gpsd.socket

So that we have /lib/systemd/system/gpsd.socket:

[Unit]
Description=GPS (Global Positioning System) Daemon Sockets

[Socket]
ListenStream=/var/run/gpsd.sock
# ListenStream=[::1]:2947
ListenStream=127.0.0.1:2947
SocketMode=0600

[Install]
WantedBy=sockets.target

It looks happy now:

jetson@jetson-nano:~$ systemctl list-units --failed
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
jetson@jetson-nano:~$ systemctl status gpsd.socket
Failed to dump process list, ignoring: No such file or directory
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
   Loaded: loaded (/lib/systemd/system/gpsd.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Fri 2021-12-10 10:15:50 CET; 1min 5s ago
   Listen: /var/run/gpsd.sock (Stream)
           127.0.0.1:2947 (Stream)
   CGroup: /system.slice/gpsd.socket

dic 10 10:15:50 jetson-nano systemd[1]: Listening on GPS (Global Positioning System) Daemon Sockets.

@mattdibi mattdibi changed the title Disabled gpsd-related services on Jetson Nano Force ipv4 in gpsd.socket on Jetson Nano Mar 17, 2022
@MMaiero
Copy link
Contributor

MMaiero commented Mar 17, 2022

That's exactly what I've meant. Maybe you'll also need to open the firewall for pot 2947 to lo

@mattdibi
Copy link
Contributor Author

mattdibi commented Mar 17, 2022

@MMaiero It didn't look like it was strictly needed by I added it anyway.

@MMaiero MMaiero merged commit 007f101 into eclipse-kura:develop Mar 17, 2022
github-actions bot pushed a commit that referenced this pull request Mar 17, 2022
* Disabled gpsd-related services

Signed-off-by: Mattia Dal Ben <[email protected]>

* Force use of ipv4 instead of disabling gpsd-related services

Signed-off-by: Mattia Dal Ben <[email protected]>

* Added firewall rule for gpsd (port 2947)

Signed-off-by: Mattia Dal Ben <[email protected]>
@mattdibi mattdibi deleted the gpsd_fix_jetson_nano branch March 17, 2022 15:05
MMaiero pushed a commit that referenced this pull request Mar 18, 2022
* Disabled gpsd-related services

Signed-off-by: Mattia Dal Ben <[email protected]>

* Force use of ipv4 instead of disabling gpsd-related services

Signed-off-by: Mattia Dal Ben <[email protected]>

* Added firewall rule for gpsd (port 2947)

Signed-off-by: Mattia Dal Ben <[email protected]>

Co-authored-by: Mattia Dal Ben <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants