Skip to content

Commit 4ac0a2c

Browse files
authored
Make restart behavior of ustreamer systemd service more resilient (#1891)
Resolves tiny-pilot/tinypilot-pro#1487 This change introduces new restart behavior in `ustreamer.service` to allow ustreamer to start more consistently. <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1891"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a>
1 parent 3f42f32 commit 4ac0a2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
[Unit]
22
Description=uStreamer - Lightweight, optimized video encoder
33
After=syslog.target network.target
4+
# Give up if we restart on failure 20 times within 5 minutes (300 seconds).
5+
StartLimitIntervalSec=300
6+
StartLimitBurst=20
47

58
[Service]
69
Type=simple
710
User=ustreamer
811
WorkingDirectory=/opt/ustreamer-launcher
912
ExecStart=/opt/ustreamer-launcher/launch
1013
Restart=always
14+
# ustreamer sometimes fails to start. Introducing extra restart time and
15+
# start limits works around this problem. More details and investigation in this
16+
# issue: https://github.com/tiny-pilot/tinypilot-pro/issues/1487
17+
RestartSec=2
1118

1219
[Install]
1320
WantedBy=multi-user.target

0 commit comments

Comments
 (0)