Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: tom22022 on May 04, 2021, 02:49:39 PM



Title: bfgminer as daemon?
Post by: tom22022 on May 04, 2021, 02:49:39 PM
I am using bfgminer as a proxy only, is there a way to run this as a daemon in the background?  Right now I have to have an open console window.


Title: Re: bfgminer as daemon?
Post by: AzagraMac on May 05, 2021, 01:54:11 PM
So I have cgminer, it starts at startup, picks configuration from the file, background process with screen, and if it stops, it starts again.

/etc/systemd/system/cgminer.service
Code:
[Unit]
Description=cgminer
After=network.target ntp.service

[Service]
Type=forking
ExecStart=/usr/bin/screen -dmS cgminer /home/$USER/cgminer-4.9.2/cgminer --sharelog /home/$USER/cgminer.log -c /home/$USER/.cgminer/cgminer.conf
ExecStop=/usr/bin/screen -S cgminer -X quit
Restart=always

[Install]
WantedBy=multi-user.target

Code:
chmod 0644 /etc/systemd/system/cgminer.service
systemctl enable cgminer.service


BTC 1DCRu4pnnwtbUYRy1evVw7TzXGW8XMwMNc


Title: Re: bfgminer as daemon?
Post by: tom22022 on May 05, 2021, 08:23:05 PM
Thanks.  Ubuntu I presume?

Any way to prioritize startups of those files?  For example, if I want to start bitcoind first, then bfgminer proxy, then cgminer last?