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

added systemd init file #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions init/cgminer.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[Unit]
Description=cgminer
After=network.target
After=graphical.target

[Service]
Type=forking
# Type=simple
User=denix

#Start:
# screen -dm creates detached session that forks.
# use this with Type=forking
ExecStart=/usr/bin/screen -LdmS cgminer /usr/local/bin/cgminer --config /home/denix/.cgminer/cgminer.conf
#
# screen -Dm creates detached session that doesn't fork.
# use this with Type=simple
# ExecStart=/usr/bin/screen -LDmS cgminer /usr/bin/cgminer --config /home/denix/cgminer.conf

#Stop:
# tell cgminer to quit (not screen), and screen will exit
ExecStop=/usr/bin/screen -S cgminer -X stuff 'q'

# or tell screen to quit and clobber cgminer - not best choice
#ExecStop=/usr/bin/screen -S cgminer -X quit
#Probably need a kill definition in case the miner is hung

#Reload:
# sending the string 'scy' (settings, restart, yes) to cgminer will
# cause a restart which will re-read config file if using one
ExecReload=/usr/bin/screen -S cgminer -X stuff 'scy'

[Install]
WantedBy=multi-user.target