Skip to content

Instantly share code, notes, and snippets.

@christiankakesa
Last active September 25, 2021 21:45
Show Gist options
  • Save christiankakesa/7b6248cfbe11928918ae2c85a98ddb26 to your computer and use it in GitHub Desktop.
Save christiankakesa/7b6248cfbe11928918ae2c85a98ddb26 to your computer and use it in GitHub Desktop.
SystemD file for Avalanche node
[Unit]
Description=AvalancheGo
Wants=network-online.target
After=network.target network-online.target
[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/go/src/github.com/ava-labs/avalanchego
ExecStart=/home/ubuntu/go/src/github.com/ava-labs/avalanchego/build/avalanchego
KillMode=process
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=AvalancheGo
Restart=on-failure
RestartSec=10
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# Deny access to /home, /root and /run/user
# ProtectHome=true
# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=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