Files
mnote/deploy/systemd/mnote-web-prod.service
Agent Board 2deaf59f7b feat: run mnote-web prod under systemd --user with auto-restart
Replace detached spawn with mnote-web-prod.service (Restart=always,
enable + Linger). prod:start installs the unit, writes env/current
symlink, and restarts via systemctl so the gateway survives kills and
logout. Also drop unused std::fs import in web_shell.
2026-07-25 14:56:42 +08:00

31 lines
960 B
Desktop File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[Unit]
Description=MNote web production gateway (user)
Documentation=file:///mnt/Data1T/mnote/scripts/prod-build-start.js
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# current 软链由 npm run prod:start 指向最新 release 目录
WorkingDirectory=/mnt/Data1T/mnote/dist/run/mnote-web-prod/current
# 生产 env 由 prod-build-start 生成(含 .env.all + bind/control-plane 覆盖)
EnvironmentFile=-/mnt/Data1T/mnote/dist/run/mnote-web-prod/env
Environment=RUST_LOG=info
ExecStart=/mnt/Data1T/mnote/dist/run/mnote-web-prod/current/mnote-web
# 崩溃/被杀后自动拉起
Restart=always
RestartSec=3
# 优雅退出窗口
TimeoutStopSec=30
KillMode=mixed
# 日志落到 journalrelease 目录内 mnote-web.log 仍可由 journalctl 旁路查看
StandardOutput=journal
StandardError=journal
SyslogIdentifier=mnote-web-prod
# 轻量资源上限,避免异常 runaway
LimitNOFILE=65536
[Install]
WantedBy=default.target