1

I haven't found any such command among the listed in the output of xmrig -h. I run the miner with "background": true in config.json.

As my xmrig is started in the background by a script that makes sure that my miner runs all the time in the background I need to know a command that gracefully exits the miner, under certain conditions included in the script. If there is such a command I would then add it to my script so that my miner can be stopped automatically. Because of the above reasons managing xmrig via tmux does not solve the problem, at least I can't see a way in which I can script starting and stopping xmrig with tmux.

John Smith
  • 245
  • 1
  • 2
  • 10

1 Answers1

4

I've created a systemd unit file for xmrig: Command line options

nano /etc/systemd/system/xmrig.service

[Unit]
Description=XMRig Daemon
After=network.target

[Service] User=user Group=user Type=simple ExecStart=/home/user/xmrig/xmrig --config=/home/user/xmrig/config.json Restart=always

[Install] WantedBy=multi-user.target

Update systemd configuration and enable xmrig for system startup:

systemctl daemon-reload
systemctl enable xmrig.service

start, stop, status as usual:

systemctl start xmrig.service
systemctl status xmrig.service
systemctl stop xmrig.service
boldsuck
  • 118
  • 6