store-ops.service 822 B

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