Skip to content

Instantly share code, notes, and snippets.

@osnwt
Last active May 23, 2018 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osnwt/7fc8702f6e9c6f455b87bb47da9c0ca7 to your computer and use it in GitHub Desktop.
Save osnwt/7fc8702f6e9c6f455b87bb47da9c0ca7 to your computer and use it in GitHub Desktop.
systemd config file to handle a coin daemon
#
# Create and edit this file here:
# /etc/systemd/system/cerberus.service
#
# Edit:
# - Description (service name)
# - User/Group (always use unprivileged user/group to run coin daemons)
# - Working directory (can be any, daemon uses hard-coded path if not given)
# - ExecStart/ExecStop (daemon and cli executables)
#
# After installing run the following as root or using sudo:
# sudo systemctl daemon-reload # do it once to update systemd conf
# suso systemctl start cerberus.service # to start daemon
# suso systemctl stop cerberus.service # to stop daemon
# suso systemctl status cerberus.service # to check daemon status
#
# More info to learn systemd:
# https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
#
[Unit]
Description=Cerberus service
After=network.target
[Service]
Type=forking
User=cbs
Group=cbs
WorkingDirectory=/home/cbs
ExecStart=/usr/local/bin/cerberusd -daemon
ExecStop=/usr/local/bin/cerberus-cli stop
Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=10s
StartLimitInterval=120s
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment