nemosminer / DSTM-equihash-miner

DSTM equihash miner
Other
34 stars 17 forks source link

Creating a service for Fedora #12

Open brynnneilson opened 6 years ago

brynnneilson commented 6 years ago

I mine using Fedora so thought I'd post the script I made so I could run zm as a service - of course you'll need to install "screen" and change paths to match your own:

CREATE ZM SERVICE

Make start script

nano start-zm-miner

#!/bin/sh
cd /home/user/Downloads/zm_0.6.1/
DISPLAY=:0 ./zm --cfg-file=zm.cfg

chmod 755 start-zm-miner

Create service

nano /lib/systemd/system/zm-miner.service

[Unit]
Description=zm-miner
After=network.target

[Service]
#Type=forking
Type=simple
User=user
Restart=always 
RestartSec=3

#Start:
ExecStart=/usr/bin/screen -LDmS zm-miner /home/user/Downloads/zm_0.6.1/start-zm-miner

#Stop:
ExecStop=/usr/bin/screen -S zm-miner -X stuff 'q'

#Reload:
ExecReload=/usr/bin/screen -S zm-miner -X stuff 'scy'

[Install]
WantedBy=multi-user.target

Start service

systemctl start zm-miner.service

Turn service on

systemctl enable zm-miner.service

Monitor output

tail -f zm.log