Use bfgminer as a service on Ubuntu (upstart)
1 min read

Use bfgminer as a service on Ubuntu (upstart)

Use bfgminer as a service on Ubuntu (upstart)

I've move my tiny miner from my mac to a linux (ubuntu) server. When I tried to run bfgminer as a normal use, I've found that it would not detect my miner, which was attached and nicely recognised by the system. Only after running it as root, it did detect and loaded it properly. So, I've figured there's no point having a terminal open at all times, but instead make it a "daemon", via upstart.

The code is simple; in /etc/init, create a file bfgminer.conf file with the following content:

description "BFGMiner script"
author "Laur Ivan <[email protected]>"

start on runlevel [2345]
stop on runlevel [!2345]

limit nofile 8192 8192

    #[ -r /etc/default/jenkins ] && . /etc/default/jenkins
    exec /usr/local/bin/bfgminer \
        -c /etc/bfgminer/bfgminer.conf \
        --api-listen --syslog
end script

The idea is to run the program with output to syslog (hence the --syslog flag). I've added --api-listen to allow API access to the program (from localhost), in case we want to monitor the behaviour.

You'll need a bfgminer.conf configuration file in /etc/bfgminer with the settings. Mine is:

"pools" : [
         "url" : "",
         "user" : "laur001.worker001",
         "pass" : "password",
         "pool-priority" : "0"
"api-mcast-port" : "4028",
"api-port" : "4028",
"expiry" : "120",
"expiry-lp" : "3600",
"gpu-dyninterval" : "7",
"log" : "5",
"no-pool-disable" : true,
"no-show-processors" : true,
"no-show-procs" : true,
"no-unicode" : true,
"queue" : "8",
"scan-time" : "60",
"skip-security-checks" : "0",
"submit-stale" : true,
"temp-hysteresis" : "3",
"shares" : "0",
"kernel-path" : "C:\\Program Files\\BFGMiner\\/share/bfgminer"