Skip to content

Commit

Permalink
dist: add a sample systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidson-Souza committed Jan 28, 2025
1 parent 5f1b8ab commit 8d4b0d8
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions contrib/init/floresta.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[Unit]
Description=Floresta: A Lightweight Utreexo-powered Bitcoin full node implementation
Documentation=https://github.com/vinteumorg/Floresta
After=network-online.target time-set.target
Wants=network-online.target


[Service]
ExecStart=/usr/bin/florestad --data-dir=/var/lib/florestad --config-file /etc/floresta/config.toml

# Don't enter a restart loop, as it might corrupt our database
Restart=no

TimeoutStartSec=infinity
TimeoutStopSec=600

# Make sure we can read from the config file
ExecStartPre=/bin/chgrp florestad /etc/florestad
User=florestad
Group=florestad

# /run/florestad
RuntimeDirectory=florestad
RuntimeDirectoryMode=0710

# /etc/florestad
ConfigurationDirectory=florestad
ConfigurationDirectoryMode=0710

# /var/lib/floresta
StateDirectory=floresta
StateDirectoryMode=0710

# 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

# Restrict ABIs to help ensure MemoryDenyWriteExecute is enforced
SystemCallArchitectures=native

[Install]
WantedBy=multi-user.target

0 comments on commit 8d4b0d8

Please sign in to comment.