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

Work as systemctl go2rtc.service #616

Closed
Sheredeka opened this issue Sep 6, 2023 · 7 comments
Closed

Work as systemctl go2rtc.service #616

Sheredeka opened this issue Sep 6, 2023 · 7 comments
Labels
question Further information is requested

Comments

@Sheredeka
Copy link

Sheredeka commented Sep 6, 2023

Hi all!

how to run binary go2rtc_linux_amd64 as system service?

im try:

[Unit]
Description=AlexxIT go2rtc
After=network.target

[Service]
Type=forking
PIDFile=/opt/go2rtc/go2rtc.pid
ExecStart=/opt/go2rtc/go2rtc_linux_amd64 -config /opt/go2rtc/go2rtc.yaml
TimeoutStopSec=5
KillMode=mixed

[Install]
WantedBy=multi-user.target

but service works until the first error message "WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="read tcp 192.168.19.149:8554->192.168.19.72:58590: i/o timeout"" then stop with error

How to config service for correct start/restart/stop ?

@felipecrs
Copy link
Contributor

Isn't systemd responsible to restart it when it fails?

@felipecrs
Copy link
Contributor

@felipecrs
Copy link
Contributor

Also, if I were you I would definitely run it as a docker container (so that docker manages the service).

@AlexxIT AlexxIT added the question Further information is requested label Sep 7, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Sep 7, 2023

I don't know. Prefer to run all software in the Docker. Your error not related with this issue.

@Sheredeka
Copy link
Author

It's not about an error, it's about the ability to launch go2rtc as a service (daemon) in the background, which will restart automatically if stopped.
systemctl go2rtc start
systemctl go2rtc restart
systemctl go2rtc stop

@AlexxIT
Copy link
Owner

AlexxIT commented Sep 7, 2023

Well. I can't help you with this. Ask on some Linux forum

@AlexxIT AlexxIT closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
@jneilliii
Copy link

jneilliii commented Sep 27, 2023

under service section can't you just add

Restart=always
RestartSec=10

might find additional hints here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants