's'
This commit is contained in:
@@ -19,6 +19,12 @@ cd /home/live/douyinyoutube # 或你的克隆路径
|
|||||||
sudo bash upgrade-live.sh
|
sudo bash upgrade-live.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
若仓库只更新了 **`live-console.service` 模板**(例如 `StartLimitIntervalSec`),可单独刷新单元:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash refresh-live-unit.sh
|
||||||
|
```
|
||||||
|
|
||||||
## What Each Script Does
|
## What Each Script Does
|
||||||
|
|
||||||
### `install-hub.sh`
|
### `install-hub.sh`
|
||||||
|
|||||||
4
refresh-live-unit.sh
Normal file
4
refresh-live-unit.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
exec bash "$ROOT_DIR/scripts/linux/refresh_live_console_unit.sh" "$@"
|
||||||
@@ -254,6 +254,8 @@ Environment=PORT=$PORT
|
|||||||
ExecStart=$ROOT_DIR/start.sh
|
ExecStart=$ROOT_DIR/start.sh
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
# 避免构建/依赖短暂失败时触发 systemd 默认「5 次/10s」后永久停跑(表现为 live-edge 502、:8001 无监听)
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -64,3 +64,15 @@ echo "2) Try: http://${LAN_IP}:${PORT}/ (direct control plane, bypasses :80 a
|
|||||||
echo "3) live.local needs mDNS (Android often OK; Windows may need Bonjour or use IP)."
|
echo "3) live.local needs mDNS (Android often OK; Windows may need Bonjour or use IP)."
|
||||||
echo "4) If OK on IP but not live.local: Avahi on this host — systemctl status avahi-daemon"
|
echo "4) If OK on IP but not live.local: Avahi on this host — systemctl status avahi-daemon"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
if ! systemctl is-active live-console.service >/dev/null 2>&1; then
|
||||||
|
echo "=== Fix live-console (your case: edge OK, :${PORT} down) ==="
|
||||||
|
echo "sudo systemctl reset-failed live-console.service 2>/dev/null || true"
|
||||||
|
echo "sudo systemctl enable --now live-console.service"
|
||||||
|
echo "sleep 3 && curl -sf http://127.0.0.1:${PORT}/health && echo OK || echo still failing — logs:"
|
||||||
|
echo "sudo journalctl -u live-console.service -n 80 --no-pager"
|
||||||
|
echo ""
|
||||||
|
echo "After git pull / code update, prefer: sudo bash upgrade-live.sh"
|
||||||
|
echo "Only systemd unit changed? sudo bash refresh-live-unit.sh"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|||||||
13
scripts/linux/refresh_live_console_unit.sh
Normal file
13
scripts/linux/refresh_live_console_unit.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# git pull 后若只改了 systemd 模板(如 StartLimit),执行本脚本重写 live-console.service 并 enable --now
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SELF_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
INSTALL_TAG="refresh-unit"
|
||||||
|
. "$SELF_DIR/lib/common.sh"
|
||||||
|
|
||||||
|
ensure_root "$@"
|
||||||
|
load_env
|
||||||
|
log "Rewriting /etc/systemd/system/live-console.service from repo"
|
||||||
|
install_live_console_service
|
||||||
|
log "Done. Check: systemctl status live-console.service --no-pager"
|
||||||
Reference in New Issue
Block a user