Systemd files

From wiki.electroncash.de
Jump to navigation Jump to search

fulcrum@.service (for user bitcoin-mainnet start with systemctl fulcrum@mainnet start)

[Unit]
Description=Fulcrum [%i] daemon
After=network.target bitcoind@.service

[Service]
#Type=forking
EnvironmentFile=/home/bitcoin-%i/fulcrum.conf
ExecStart=/usr/local/bin/Fulcrum /home/bitcoin-%i/fulcrum.conf
User=bitcoin-%i
Group=bitcoin-%i
LimitNOFILE=8192
TimeoutStopSec=30min

[Install]
WantedBy=multi-user.target

bitcoind@.service (for user bitcoin-mainnet start with systemctl bitcoind@mainnet start)

[Unit]
Description=Bitcoin Cash [%i] P2P Digital Currency daemon
After=network.target

[Service]
User=bitcoin-%i
Group=bitcoin-%i

Type=forking
PIDFile=/home/bitcoin-%i/.bitcoin/bitcoind.pid
ExecStart=/usr/local/bin/bitcoind -daemon -pid=/home/bitcoin-%i/.bitcoin/bitcoind.pid -conf=/home/bitcoin-%i/.bitcoin/bitcoin.conf -datadir=/home/bitcoin-%i/.bitcoin -disablewallet
RuntimeDirectory=bitcoind
Restart=on-failure

PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
PrivateDevices=true
MemoryDenyWriteExecute=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5

[Install]
WantedBy=multi-user.target

bitcoin-seeder.service

[Unit]
Description=Bitcoin Seeder
After=network.target

[Service]
User=root
#User=bitcoin-mainnet
#Group=bitcoin-mainnet
ExecStart=/usr/local/bin/bitcoin-seeder -host=dnsseed.electroncash.de -ns=electroncash.de -mbox=admin.electroncash.de
TimeoutStopSec=30min
StartLimitBurst=0
Restart=on-failure

[Install]
WantedBy=multi-user.target

bitcoin-prometheus-exporter.service

[Unit]
Description=Bitcoin Cash Prometheus Exporter
After=network.target

[Service]
User=bitcoind
Group=bitcoind

Type=simple
Environment=BITCOIN_RPC_HOST=127.0.0.1
Environment=BITCOIN_RPC_PORT=8332
Environment=BITCOIN_RPC_USER=rpcadmin
Environment=BITCOIN_RPC_PASSWORD=rpclogon
Environment=METRICS_PORT=8339
ExecStart=/usr/local/src/bitcoin-prometheus-exporter/env/bin/python /usr/local/src/bitcoin-prometheus-exporter/bitcoind-monitor.py

Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5

ProtectSystem=full
NoNewPrivileges=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target

fulcrum-prometheus-exporter.service

[Unit]
Description=Fulcrum Mainnet Prometheus Exporter
After=network.target

[Service]
User=bitcoin-mainnet
Group=bitcoin-mainnet

Type=simple
Environment=FULCRUM_STATS_URL=http://127.0.0.1:12012/stats
Environment=REFRESH_SECONDS=30
Environment=METRICS_PORT=50039
ExecStart=/usr/bin/python3 /usr/local/src/fulcrum-prometheus-exporter/fulcrum-monitor.py

Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5

ProtectSystem=full
NoNewPrivileges=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target