Skip to content

Instantly share code, notes, and snippets.

@anyxem
Created January 18, 2024 22:46
Show Gist options
  • Save anyxem/084e413167c283d42e7d7f4ad403c3ec to your computer and use it in GitHub Desktop.
Save anyxem/084e413167c283d42e7d7f4ad403c3ec to your computer and use it in GitHub Desktop.
Run node as a service
$ sudo vim /etc/systemd/system/mltnode.service
Insert
[Unit]
Description=ML Node Daemon
After=network.target
[Service]
Type=Simple
User=safeuser
ExecStart=/home/safeuser/mintlayer/node-daemon # or exact path to your node-daemon
StandardOutput=file:/home/safeuser/mintlayer/mlnode.log
StandardError=file:/home/safeuser/mintlayer/mlnode-error.log
TimeoutStopSec=10
KillSignal=SIGINT
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
ESC
Press ZZ to save changes
$ sudo systemctl daemon-reload # to reload systemctl
$ sudo systemctl enable mltnode.service # to enable auto-run after server restart
$ sudo systemctl start mltnode.service # to kickstart service itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment