Files
miner/examples/systemd/quantus-miner.service
T
illuzen 63d7e114c2 Support new pow algo on cpu, not gpu (#22)
* support new pow algo, remove montgomery

* format

* remove redundant check

* use local poseidon until we release

* back to release

* remove unnecessary fxn

* comment out cuda for now

* comment out open-cl

* fix more tests

* remove cuda jobs
2025-11-03 16:23:18 +08:00

92 lines
2.9 KiB
Desktop File

# Quantus External Miner - systemd unit
#
# Install:
# - Place this file at: /etc/systemd/system/quantus-miner.service
# - Optional environment file:
# * /etc/default/quantus-miner (Debian/Ubuntu)
# * /etc/sysconfig/quantus-miner (RHEL/CentOS/Fedora)
# - Optional overrides (recommended for CPU affinity/scheduling):
# * Create drop-ins in: /etc/systemd/system/quantus-miner.service.d/*.conf
# See examples in: examples/systemd/overrides/
#
# Usage:
# sudo systemctl daemon-reload
# sudo systemctl enable --now quantus-miner.service
#
# Notes:
# - The miner CLI supports environment variables for all flags (see README):
# MINER_PORT, MINER_METRICS_PORT, MINER_WORKERS, MINER_ENGINE,
# MINER_PROGRESS_CHUNK_MS,
# MINER_MANIP_SOLVED_BLOCKS, MINER_MANIP_BASE_DELAY_NS,
# MINER_MANIP_STEP_BATCH, MINER_MANIP_THROTTLE_CAP.
# This unit relies on those env vars (set in /etc/default|/etc/sysconfig) so
# ExecStart can remain stable and simple.
# - The service logs the detected cpuset mask (if any) and emits a
# miner_effective_cpus metric when metrics are enabled.
[Unit]
Description=Quantus External Miner Service
Wants=network-online.target
After=network-online.target
Documentation=https://github.com/Quantus-Network/quantus-miner
[Service]
Type=simple
# Run under a dedicated service account (create if it does not exist).
# sudo useradd --system --no-create-home --shell /usr/sbin/nologin quantus
User=quantus
Group=quantus
# State directory (auto-created by systemd with correct permissions)
StateDirectory=quantus-miner
WorkingDirectory=/var/lib/quantus-miner
# Load environment from distro-specific location if present.
# Debian/Ubuntu:
EnvironmentFile=-/etc/default/quantus-miner
# RHEL/CentOS/Fedora:
EnvironmentFile=-/etc/sysconfig/quantus-miner
# Default logging level (can be overridden in env files)
Environment=RUST_LOG=info
# Launch the miner. All configuration should be passed via environment vars
# (preferred) or via EXTRA_MINER_FLAGS in the env file for additional arguments.
ExecStart=/usr/local/bin/quantus-miner $EXTRA_MINER_FLAGS
# Graceful shutdown and restart behavior
Restart=always
RestartSec=2s
TimeoutStopSec=30s
KillSignal=SIGINT
StartLimitIntervalSec=0
# Journald logging
StandardOutput=journal
StandardError=journal
# Security hardening (relaxed enough to allow network + file access)
NoNewPrivileges=true
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
RestrictNamespaces=true
LockPersonality=true
RestrictSUIDSGID=true
SystemCallFilter=@system-service
# Resource controls (tune via drop-in overrides for your environment)
# These are commented here; see examples/systemd/overrides for presets.
# Nice=-5
# IOSchedulingClass=best-effort
# IOSchedulingPriority=2
# CPUAffinity=0 2 4 6
# CPUSchedulingPolicy=other
# CPUWeight=90
# MemoryMax=infinity
# TasksMax=infinity
[Install]
WantedBy=multi-user.target