-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtg-monitor-frontend.service
More file actions
36 lines (30 loc) · 1.25 KB
/
Copy pathtg-monitor-frontend.service
File metadata and controls
36 lines (30 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[Unit]
Description=Telegram Monitor Frontend Service
Documentation=https://github.com/xingchuan/tg-monitor
After=network.target tg-monitor-backend.service
Wants=network.target
[Service]
Type=simple
User=xingchuan
Group=xingchuan
WorkingDirectory=/home/xingchuan/桌面/tgjiankong/frontend
Environment=PATH=/home/xingchuan/.nvm/versions/node/v24.13.0/bin:/usr/local/bin:/usr/bin:/bin
Environment=NODE_ENV=production
PIDFile=/home/xingchuan/桌面/tgjiankong/frontend.pid
# 启动前清理可能残留的进程
ExecStartPre=/bin/sh -c 'killall -9 node vite 2>/dev/null || true; killall -9 esbuild 2>/dev/null || true; rm -f /home/xingchuan/桌面/tgjiankong/frontend.pid'
ExecStart=/home/xingchuan/.nvm/versions/node/v24.13.0/bin/npm run dev
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/sh -c 'kill $MAINPID 2>/dev/null; rm -f /home/xingchuan/桌面/tgjiankong/frontend.pid; killall -9 node vite 2>/dev/null || true; killall -9 esbuild 2>/dev/null || true'
KillMode=process
KillSignal=SIGTERM
TimeoutStopSec=30
Restart=always
RestartSec=5
StandardOutput=append:/home/xingchuan/桌面/tgjiankong/logs/frontend.log
StandardError=append:/home/xingchuan/桌面/tgjiankong/logs/frontend.log
# 安全设置
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target