0

I have 10 GPU attached to one system and want to mine with all, as ubuntu GUI not allow to run 10 GPU at a time, So will go with the command line and able to mine there.

Now I want to run my miner on system startup for particular this I am following this tutorial (step-7). I have done all the things as per tutorial but not able to start ./start_only_eth.bash command(no screen session created) in screen session.

If I am executing below command, I am able to find this session using "screen -ls" command.

screen -dmS ethm

Below is my script (demo.sh)

// update

#!/bin/bash
DEFAULT_DELAY=0
if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
   DELAY=$DEFAULT_DELAY
else
   DELAY=$1
fi
sleep $DELAY
su aman -c "screen -dmS ethm /home/aman/Desktop/claymore/start_only_eth.bash"

I have added this script's path in rc.local file as mentioned in this tutorial (step-7).

below is my rc.local

#!/bin/sh -e
#
# rc.local
#
# 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 
# bits.
#
# By default this script does nothing.

 sh '/home/aman/Desktop/demo.sh'
  exit 0

After restart if I execute "screen -ls" command I got below message

No Sockets found in /var/run/screen/S-aman.

Note: I think problem is not in rc.local, problem is in demo.sh. If try to execute demo.sh manually the script will fail and got above message.

// // -------------------------- With TMUX -------------------- // //

I have also tried this with tmux, this time I am able to run miner(manually) in tmux session but again fail to run script using rc.local for this below is my demo.sh

#!/bin/bash
tmux new-session -d -n MINER
tmux send-keys -t MINER "cd /home/aman/Desktop/claymore" C-m
tmux send-keys -t MINER "./start_only_eth.bash" C-m

Below is what I am getting(console) when try to test rc.local

aman@aman-System-Product-Name:~$ sudo /etc/init.d/rc.local start
[sudo] password for aman: 
[ ok ] Starting rc.local (via systemctl): rc.local.service.
  • What error message do you get when you run your script? – vidarlo Jun 2 '18 at 16:59
  • I am getting "No Sockets found in /var/run/screen/S-aman." when executing screen -ls – Anand Suthar Jun 2 '18 at 17:05
  • But what do you get when you start your script demo.sh in a terminal? – vidarlo Jun 2 '18 at 17:17
  • 1.) If I run demo.sh (tmux) manually, mining will start but same script will not work with rc.local. 2) If I run demo.sh (screen) manually nothing will happen and also not work in rc.local. I am not getting any error in script. (They are just not working in rc.local - on system startup) – Anand Suthar Jun 2 '18 at 17:20
0
cd /home/Desktop/claymore
su aman -c "screen -dmS ethm ./start_only_eth.bash"

There's multiple problems with this. First of all, the path is likely to be /home/username/Desktop/claymore. Second, the cd affects the current script, and is likely not carried over to screen, across the su.

Try:

su aman -c "screen -dmS ethm /home/username/Desktop/claymore/start_only_eth.bash"

If the script start_only_eth.bash requires to have PWD set to that directory, place a line with

cd /home/username/Desktop/claymore

as the second line of the script.

Replace username with the actual username.

  • I have tried this but no luck for this I have update my question please check. – Anand Suthar Jun 2 '18 at 16:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.