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

If str2str_tcp is restarted, gpsd is stopped and doesn't restart #94

Closed
Stefal opened this issue Jul 22, 2020 · 4 comments · Fixed by #216
Closed

If str2str_tcp is restarted, gpsd is stopped and doesn't restart #94

Stefal opened this issue Jul 22, 2020 · 4 comments · Fixed by #216
Assignees
Labels
bug Something isn't working

Comments

@Stefal
Copy link
Owner

Stefal commented Jul 22, 2020

No description provided.

@Stefal Stefal added the bug Something isn't working label Jul 22, 2020
@Stefal Stefal self-assigned this Jul 22, 2020
@Stefal
Copy link
Owner Author

Stefal commented Feb 22, 2022

Creating a .conf file in /etc/systemd/system/gpsd/ seems a good solution:
https://serverfault.com/questions/840996/modify-systemd-unit-file-without-altering-upstream-unit-file

example: a restart.conf file with this in it:

[Service]
Restart=always

Stefal added a commit that referenced this issue Feb 23, 2022
@Stefal
Copy link
Owner Author

Stefal commented Feb 23, 2022

It was easier to add the command directly inside the service file, as I already do some modifications in it during the installation.

@Stefal
Copy link
Owner Author

Stefal commented Feb 28, 2022

related to systemd/systemd#1312

@Stefal
Copy link
Owner Author

Stefal commented Mar 1, 2022

This seems to work, but need more tests:

[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
After=str2str_tcp.service

[Service]
Type=forking
EnvironmentFile=-/etc/default/gpsd
ExecStartPre=/usr/bin/systemctl is-active str2str_tcp.service
ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
Also=gpsd.socket

⚠️ Check the path to systemctl with which systemctl and edit it inside the gpsd unit if needed.

EDIT : It looks like the absolute path to systemctl is not needed anymore as systemd search for the executable in various path. We can check this with sudo systemd-path search-binaries-default

Stefal added a commit that referenced this issue Mar 2, 2022
Stefal added a commit that referenced this issue Mar 6, 2022
Should fix gpsd starting problems #94
@Stefal Stefal mentioned this issue Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant