Skip to content

Instantly share code, notes, and snippets.

@m3dwards
Last active September 18, 2023 13:57
Show Gist options
  • Save m3dwards/fb64e22b2e21ea36cf3face2148c777b to your computer and use it in GitHub Desktop.
Save m3dwards/fb64e22b2e21ea36cf3face2148c777b to your computer and use it in GitHub Desktop.
Core Lightning CLN systemd service unit (/etc/systemd/system/core-lightning.service)
[Unit]
Description=Core Lightning
After=network.target
[Service]
ExecStart=/usr/local/bin/lightningd --alias myalias --rbg 000000 --network bitcoin --daemon --pid-file /run/lightningd/lightningd.pid --log-file /home/bitcoin/.lightning/debug.log --proxy 127.0.0.1 --fee-base=0 --fee-per-satoshi=25
PermissionsStartOnly=yes
RuntimeDirectoryMode=0775
RuntimeDirectory=lightningd
RuntimeDirectoryPreserve=yes
User=bitcoin
Group=bitcoin
Type=forking
Restart=on-failure
RestartSec=20
PIDFile=/run/lightningd/lightningd.pid
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment