Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Last active November 3, 2022 16:51
Show Gist options
  • Save alexbosworth/171958cc9888b7ebf3a91e5c23a57464 to your computer and use it in GitHub Desktop.
Save alexbosworth/171958cc9888b7ebf3a91e5c23a57464 to your computer and use it in GitHub Desktop.

systemd

Edit:

sudo emacs /etc/systemd/system/lnd.service
[Service]
Environment=HOME=/home/ubuntu
ExecStart=/home/ubuntu/go/bin/lnd
ExecStop=/home/ubuntu/go/bin/lncli stop
Restart=always
RestartSec=30
StandardOutput=null
StandardError=null
SyslogIdentifier=lnd
User=ubuntu
Group=ubuntu

[Install]
WantedBy=multi-user.target

Commands:

# start
sudo systemctl start lnd

# restart
sudo systemctl restart lnd

# monitor
journalctl -fu lnd

# run at startup
sudo systemctl enable lnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment