I've got a RapsberryPi, connected up all the hardware, installed, updated & upgraded all the software.
This is now much easier... after a few months refresher with Ubuntu. So before I start connecting random hardware I'm doing a concept test with the unit and some ASIC miners. Then its Cental Heating & the solar panels. Then some kitchen appliances!
Installed & compiled 'bfgminer' (coin mining) via github
Installed 'screen' (multi-window terminal tool - start disconnected/reconnect to processes) via app-get.
This is first step to wiring up a lot of things in the house.
And for me it's good practice - I only learn when it goes wrong!
This is my BFGminer_RemoteRun script - which works as I want it when I run it over my PuTTy terminal:
# BFGMiner [email@example.com]
# Run in background
# 'Screen' installed - screen -r to reattach
screen -dmS bfgminer ./bfgminer -o http://xxxx:xxxx -u xxxx -p xxxx -S icarus:all
I then amendeded /etc/rc.local as follows:
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
# My Custom Scripts
When I run
/etc/rc.local OR ./bfgminer/BFGminer_RemoteRun
from prompt it runs one instance I can connect to with
screen -r <detached session>
pgrep -f bfg
Reports only one process.
When I restart the system I know the script runs; I know it's running server connected and updating as the pool shows process.
pgrep -f bfg 3 processes running!
screen -ls No detached screens to connect to(?).
But I can't connect to it to reconfigure hardware/pools etc over ssh - whihc is the whole point of this exercise - to stop using desktops/GUI and work command line full time.
What am I missing? At this point I'm guessing either:
Init.d scripts must execute differently - and I need to modify BFGminer_RemoteRun file contents/configuration
'screen' needs different options to be parsed as a startup script.
I did try to add a user onto the system and get screen to run under that profile - but it kept prompting for a password.
Learnt a lot today but brain now dead.
Suggestions or directions would be wonderful!
If I can't get 'screen' to do this then I need an alternative