-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Refine service to restart SRS for systemd #2552
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.0release #2552 +/- ##
===========================================
Coverage 59.33% 59.33%
===========================================
Files 122 122
Lines 51556 51556
===========================================
Hits 30592 30592
Misses 20964 20964 Continue to review full report at Codecov.
Translated to English:
|
This is restarting the SRS service after SRS exits? I looked at this article, do we need to set https://unix.stackexchange.com/a/324297 I would like to extend Rahul's answer a bit. systemd tries to restart multiple times (StartLimitBurst) and stops trying if the attempt count is reached within StartLimitIntervalSec. Both options belong to the [unit] section. The default delay between executions is 100ms (RestartSec) which causes the rate limit to be reached very fast. systemd won't attempt any more automatic restarts ever for units with Restart policy defined:
Rahul's answer helps, because the longer delay prevents reaching the error counter within the StartLimitIntervalSec time. The correct answer is to set both RestartSec and StartLimitBurst to reasonable values though.
|
Recently, the project used SRS. My colleague encountered a problem where SRS would suddenly stop when testing the push-pull stream (no error logs, the process just disappeared, and a coredump file was generated). My colleague couldn't access SRS, so they contacted me and I found out that SRS had already stopped. The solution I used was to add the "Restart=always" field in the srs.service file. If SRS crashes, the daemon process can immediately restart. I didn't use RestartSec because I wanted SRS to start immediately and provide services. After adding Restart=always in the test, when manually killing the SRS process, systemd will automatically restart SRS. Currently, this can solve the problem with the daemon process. The downside is that for earlier distributions without systemd, such as CentOS 6 and Ubuntu 14, this file has no effect and the srs script under init.d needs to be rewritten.
|
Merged as 54b706d Thanks a lot 👍 @mawenwu1983 |
No description provided.