This PR overrides the default Janus systemd config in order set additional systemd settings. Specifically:
[Unit]
Description=Janus WebRTC gateway
After=network.target
Documentation=https://janus.conf.meetecho.com/docs/index.html
+# Give up if we restart on failure 20 times within 5 minutes (300 seconds).
+StartLimitIntervalSec=300
+StartLimitBurst=20
[Service]
Type=forking
ExecStart=/usr/bin/janus --disable-colors --daemon --log-stdout
Restart=on-failure
+RestartSec=1
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Janus with STUN requires the network to be online, otherwise janus fails to start. Theses additional settings are needed to allow Janus with STUN settings a better chance of starting up successfully, by giving it more chances to restart on failure. Seeing as STUN is an optional setting, we didn't want Janus to always require an online network because it might unnecessarily delay TinyPilot's H.264 video stream.
Testing
To enable STUN, append the following block to /etc/janus/janus.jcfg:
Now if you restart your device, the janus service should start successfully on boot. On my device janus restarted 8 times in 12 seconds before successfully running.
Resolves https://github.com/tiny-pilot/tinypilot/issues/1578
This PR overrides the default Janus systemd config in order set additional systemd settings. Specifically:
Janus with STUN requires the network to be online, otherwise
janus
fails to start. Theses additional settings are needed to allow Janus with STUN settings a better chance of starting up successfully, by giving it more chances to restart on failure. Seeing as STUN is an optional setting, we didn't want Janus to always require an online network because it might unnecessarily delay TinyPilot's H.264 video stream.Testing
To enable STUN, append the following block to
/etc/janus/janus.jcfg
:Now if you restart your device, the
janus
service should start successfully on boot. On my devicejanus
restarted 8 times in 12 seconds before successfully running.