Skip to content

Instantly share code, notes, and snippets.

@fr3qu3ncy
Created January 17, 2022 17:25
Show Gist options
  • Save fr3qu3ncy/3ab5cf89db8016984e96a9601f073b54 to your computer and use it in GitHub Desktop.
Save fr3qu3ncy/3ab5cf89db8016984e96a9601f073b54 to your computer and use it in GitHub Desktop.
ScPrime run spd as a daemon with systemd service on Linux
# This is a SystemD unit file for the ScPrime daemon
# To configure:
# - Update the user and group that the service will run as (User & Group below)
# - Ensure that the spd and spc binaries are in /var/opt/scprime/latest-version/ and is named spd
# (or edit the ExecStart and ExecStop lines below to reflect the name and location of your binary)
# - Ensure that you've set SCPRIME_WALLET_PASSWORD to your wallet password)
#
# To use:
# - Place this file in /etc/systemd/system/ or wherever your SystemD unit files are stored
# - Run systemctl daemon-reload
# - To start run systemctl start scprime (or service scprime start)
[Unit]
Description = ScPrime spd daemon service
After = syslog.target network-online.target
Wants = network-online.target
[Service]
Environment = SCPRIME_WALLET_PASSWORD=yourwalletpassword
Type = simple
User = scprime
Group = scprime
ExecStart = /var/opt/scprime/latest-version/spd -M gctwh
ExecStop = /var/opt/scprime/latest-version/spc stop
Restart = always
NotifyAccess = main
[Install]
Alias = scprime
WantedBy = multi-user.target
@fr3qu3ncy
Copy link
Author

  • Create the systemd service file, edit contents of /etc/systemd/system/scprime.service sudo nano /etc/systemd/system/scprime.service
  • Run systemctl daemon-reload for systemd to pick up the new service
  • To start run systemctl start scprime (or service scprime start)
  • Enable the new systemd unit for autostart systemctl enable scprime so it starts on boot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment