Post
Topic
Board Mining software (miners)
Re: cgmon - cgminer monitor for Linux - auto restart, reboot, sick gpu detect &more
by
ckopobapka
on 15/02/2014, 23:29:57 UTC
I've made a simple startup init-script for BAMT that runs cgmon in virtual screen without using cron. I think it's more convenient way to debug and control cgmon.

1. copy cgmon_wrapper.sh from http://yadi.sk/d/34zlbFhWHx4ua to any directory you want. I keep it in "/opt/cgmon/"

2. copy cgmon_daemon from http://yadi.sk/d/aKU8Zr6nHx4ug to "/etc/init.d/" directory on your BAMT.
Configure it according to your system:
a) At the end of the 4th line:
Code:
# Required-Start:    $remote_fs $syslog mine
... I've added word "mine", because cgmon_daemon needs to be runned only after "/etc/init.d/mine" script. You may add your own here...

b) In the 22th line:
Code:
DAEMON_ARGS="-DmS cgmon_daemon /opt/cgmon/cgmon_wrapper.sh"
... if you saved cgmon_wrapper.sh in other dirctory, you need to fix the line according to your cgmon_wrapper.sh path.

3. Make the scripts executable:
Code:
sudo chmod 755 /etc/init.d/cgmon_daemon
sudo chmod 755 /opt/cgmon/cgmon_wrapper.sh #write here your own cgmon_wrapper.sh path if it differs

4. Enable autostart:
Code:
sudo update-rc.d cgmon_daemon defaults
sudo update-rc.d cgmon_daemon enable

5. You may start it by hands:
Code:
sudo /etc/init.d/cgmon_daemon start
Also, you restart and stop it.

6. To view a virtual screen use:
Code:
sudo screen -r cgmon_daemon
To exit from the screen use "Ctrl+a d"