Skip to content

Instantly share code, notes, and snippets.

@GongT
Created November 8, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GongT/6cf51ec5802f64d8d522b4e68c13efaa to your computer and use it in GitHub Desktop.
Save GongT/6cf51ec5802f64d8d522b4e68c13efaa to your computer and use it in GitHub Desktop.
Systemd service file for long running nodejs project, eg, a website.
[Unit]
Description=Auto run UMI UI
After=data.mount
# Requires=mariadb.service
[Service]
Type=simple
Restart=on-failure
Environment=DISPLAY= HOST=0.0.0.0 UMI_PORT=15000 UMI_UI_BROWSER=none DEBUG=umiui:*
ExecStart=/usr/local/bin/umi ui
# ExecStart=/usr/bin/ncat -kl 6666 --exec /bin/bash
KillMode=control-group
User=GongT
ProtectSystem=strict
PrivateTmp=yes
ReadOnlyPaths=/
ReadWritePaths=/data/DevelopmentRoot
ReadWritePaths=/data/Cache
ReadWritePaths=/data/AppData/config/umi-js
Environment=HOME=/data/AppData/config/umi-js
WorkingDirectory=/data/AppData/config/umi-js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment