This commit is contained in:
eric
2026-03-29 04:10:44 -05:00
parent 63443ea854
commit e20c1a0b0b
5 changed files with 37 additions and 0 deletions

View File

@@ -19,6 +19,12 @@ cd /home/live/douyinyoutube # 或你的克隆路径
sudo bash upgrade-live.sh
```
若仓库只更新了 **`live-console.service` 模板**(例如 `StartLimitIntervalSec`),可单独刷新单元:
```bash
sudo bash refresh-live-unit.sh
```
## What Each Script Does
### `install-hub.sh`

4
refresh-live-unit.sh Normal file
View 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" "$@"

View File

@@ -254,6 +254,8 @@ Environment=PORT=$PORT
ExecStart=$ROOT_DIR/start.sh
Restart=always
RestartSec=5
# 避免构建/依赖短暂失败时触发 systemd 默认「5 次/10s」后永久停跑表现为 live-edge 502、:8001 无监听)
StartLimitIntervalSec=0
[Install]
WantedBy=multi-user.target

View File

@@ -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 "4) If OK on IP but not live.local: Avahi on this host — systemctl status avahi-daemon"
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

View 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"