ops: persist livekit-server and camera fleet as systemd 24/7 units
This commit is contained in:
@@ -82,18 +82,19 @@ lightweight high-pass + soft-clip DSP path so streams still work.
|
|||||||
Until the 1 s window is full, hops use the DSP fallback so LiveKit is
|
Until the 1 s window is full, hops use the DSP fallback so LiveKit is
|
||||||
not silent on startup.
|
not silent on startup.
|
||||||
|
|
||||||
## systemd (optional, not enabled)
|
## systemd (enabled, 24/7)
|
||||||
|
|
||||||
|
Two units, enabled for multi-user.target:
|
||||||
|
|
||||||
|
- `livekit-server.service` — `/usr/local/bin/livekit-server` + `deploy/livekit-server.yaml` (:7880)
|
||||||
|
- `livekit-cameras.service` — `run.py` (Requires livekit-server)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo cp deploy/livekit-cameras.service /etc/systemd/system/
|
systemctl status livekit-cameras livekit-server
|
||||||
sudo systemctl daemon-reload
|
journalctl -u livekit-cameras -f
|
||||||
# only if you want 24/7:
|
systemctl restart livekit-cameras # pick up newly plugged cameras
|
||||||
sudo systemctl enable --now livekit-cameras
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Requires a LiveKit server already listening (this host uses
|
|
||||||
`/tmp/livekit-server --config /tmp/livekit-test.yaml` on :7880).
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Video uses MJPG directly from the UVC interface (`ffmpeg -f v4l2
|
- Video uses MJPG directly from the UVC interface (`ffmpeg -f v4l2
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Publish C920 cameras (speechbrain audio) to LiveKit
|
Description=Publish C920 cameras (speechbrain audio) to LiveKit
|
||||||
After=network-online.target sound.target
|
After=network-online.target sound.target livekit-server.service
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
Requires=livekit-server.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/home/fdenkena/livekit-cameras
|
WorkingDirectory=/home/fdenkena/livekit-cameras
|
||||||
ExecStart=/home/fdenkena/livekit-cameras/.venv/bin/python /home/fdenkena/livekit-cameras/run.py
|
ExecStart=/home/fdenkena/livekit-cameras/.venv/bin/python /home/fdenkena/livekit-cameras/run.py
|
||||||
Restart=on-failure
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
TimeoutStopSec=30
|
||||||
|
KillMode=control-group
|
||||||
Environment=PYTHONUNBUFFERED=1
|
Environment=PYTHONUNBUFFERED=1
|
||||||
Environment=LIVEKIT_URL=ws://127.0.0.1:7880
|
Environment=LIVEKIT_URL=ws://127.0.0.1:7880
|
||||||
|
Environment=ENHANCE_MODE=force
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=LiveKit server for the C920 camera fleet
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/bin/livekit-server --config /home/fdenkena/livekit-cameras/deploy/livekit-server.yaml
|
||||||
|
Restart=always
|
||||||
|
RestartSec=2
|
||||||
|
LimitNOFILE=65536
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
port: 7880
|
||||||
|
bind_addresses:
|
||||||
|
- 127.0.0.1
|
||||||
|
- 10.200.0.20
|
||||||
|
keys:
|
||||||
|
devkey: devsecret
|
||||||
|
rtc:
|
||||||
|
tcp_port: 7881
|
||||||
|
udp_port: 7882
|
||||||
|
use_external_ip: false
|
||||||
|
node_ip: 10.200.0.20
|
||||||
|
logging:
|
||||||
|
level: info
|
||||||
Reference in New Issue
Block a user