Skip to content

Instantly share code, notes, and snippets.

@albert-zhang
Created February 13, 2019 10:09
Show Gist options
  • Save albert-zhang/cf56a794a9c83e01fc309a50fcbd7430 to your computer and use it in GitHub Desktop.
Save albert-zhang/cf56a794a9c83e01fc309a50fcbd7430 to your computer and use it in GitHub Desktop.
upstart

create file the-name.service at /etc/systemd/system:

[Unit]
Description=the-desc
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/env node /path/to/index.js

[Install]
WantedBy=multi-user.target

commands:

systemctl start the-name
systemctl stop the-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment