Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a service for Fedora #12

Open
brynnneilson opened this issue May 24, 2018 · 0 comments
Open

Creating a service for Fedora #12

brynnneilson opened this issue May 24, 2018 · 0 comments

Comments

@brynnneilson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant