# store-ops —— systemd 服务模板 # # 安装: # sudo cp deploy/store-ops.service /etc/systemd/system/ # 把下面的 WorkingDirectory / ExecStart 改成你的实际路径 # sudo systemctl daemon-reload # sudo systemctl enable --now store-ops # # 查看日志:sudo journalctl -u store-ops -f [Unit] Description=门店检测工作台 Store Ops After=network.target [Service] Type=simple # ↓↓↓ 改成实际路径 ↓↓↓ WorkingDirectory=/opt/store-ops ExecStart=/bin/bash /opt/store-ops/start.sh # 以普通用户运行(不要用 root) User=storeops Group=storeops Restart=always RestartSec=5 StandardOutput=journal StandardError=journal # 只允许本机访问(前面挂 nginx 时用),要直接对外就把 --local 去掉 Environment=PORT=8787 [Install] WantedBy=multi-user.target