Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example xmr-stak systemd service unit file.
[Unit]
Description=xmr-stak miner
After=syslog.target network.target
[Service]
Type=simple
# interesting info about starting as regular user: https://bbs.archlinux.org/viewtopic.php?id=162297
User=username
LimitMEMLOCK=256M
EnvironmentFile=-/etc/sysconfig/xmr-stak
ExecStart=/path/xmr-stak/bin/xmr-stak --currency monero -o pool.example.com:3333 -u my_wallet -p x --config /path/xmr-stak/config.txt --cpu /path/xmr-stak/cpu.txt
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
# save this file in /etc/systemd/system/xmr-stak.service
# systemctl enable xmr-stak
# systemctl start xmr-stak
# note, xmr-stak executable must have selinux context unconfined_u:object_r:bin_t:s0
@semeion

This comment has been minimized.

Copy link

semeion commented Jul 14, 2018

Hello! What is that EnvironmentFile=-/etc/sysconfig/xmr-stak ? I don´t have this file and/or that directoy on my system.

BTW nice jobs on this systemd service, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.