News:

If you are a member of the Team on BOINC you still need to register on this forum to see the member posts.  The posts available for visitors are not posted to much by members.
 Remember to answer the questions when Registering and also you must be a active member of Team BOINC@AUSTRALIA on BOINC.

Main Menu

Multiple LINUX BOINC Instances

Started by Dingo, December 17, 2019, 10:01:27 PM

Previous topic - Next topic

Dingo

#15
This is the change password script for Linux based on the mult BOINC instances installation that I started this post with.
If you created your instances using the instructions in this post then the gui_rpc_auth.cfg file contains a 32 character password.  If you want to know the password of an instance then you need to look it up in that file and every instance is different.  Setting all the passwords the same should make it easier to attach to BoincTasks and run scripts.

I still haven't been able to attach to an Instance of BOINC with a script.  I always get the error "can't connect to 127.0.1.1"

format to run this acript is sh change_password.sh -a your password -b anything but must enter something (Not used)

nano change_password.sh

Insert this code and change the n= to the starting instance and max= to the last instance.  Try it out on a couple and have a look and make sure it worked before doing all instances.

press Ctrl+x then y then enter to save



#!/usr/bin/bash
#!/bin/bash
#!/bin/bash
#
#  Script Name change_password.sh
#
#
helpFunction()
{
   echo ""
   echo "Eg: sh change_password.sh -a New Password -b Press any key as not used."
   echo "Usage: $0 -a"
   echo -e "\t-a Enter the new password that will go on all instances in the loop"
   echo -e "\t-b Not used but must enter something"
       exit 1 # Exit script after printing help
}

while getopts "a:b:" opt
do
   case "$opt" in
      a ) passwd="$OPTARG" ;;
      b ) operation="$OPTARG" ;;

      ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
   esac
done

# Print helpFunction in case parameters are empty
if [ -z "$passwd" ] || [ -z "$operation" ]
then
   echo "Some or all of the parameters are empty";
   helpFunction
fi
n=100;
max=102;
while [ "$n" -le "$max" ]; do

   echo "$passwd"> /usr/bin/multiboinc/BOINC_"$n"/gui_rpc_auth.cfg;
   echo "BOINC_$n $passwd";

   n=`expr "$n" + 1`;
done




Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

Dingo

#16
OK another script for Linux.  Can  do any of the following as the second input

#   reset: delete current work and get more;
#   detach: delete current work and don't get more;
#   update: contact scheduling server;
#   suspend: stop work for project;
#   resume: resume work for project;
#   nomorework: finish current work but don't get more;
#   allowmorework: undo nomorework
#   detach_when_done: detach project

You have to set the following in the script for the time being.  I might get around to adding them as inputs later.

n= enter the number of the boinc installation to start at
max= enter the number of the boinc installation to stop at
--passwd "enter the password that you used when you used the change_password.sh"
NOTE:  The password must be in quotes "gdgdgd"

The command line parameters are sh change_instances.sh a- URL of the project -b "Enter reset deatch update suspend resume nomorework allowmorework or detach"

eg  sh change_instances.sh -a http://nci.goofyxgridathome.net/ -b detach

The code is as follows.  Create a file called  change_instances.sh

insert the following code and save:


#!/usr/bin/bash
#!/bin/bash
#!/bin/bash
#
#  Script Name change_instances.sh
#
#  Can  do any of the following as the second input
#   reset: delete current work and get more;
#   detach: delete current work and don't get more;
#   update: contact scheduling server;
#   suspend: stop work for project;
#   resume: resume work for project;
#   nomorework: finish current work but don't get more;
#   allowmorework: undo nomorework
#   detach_when_done: detach project
#
#
helpFunction()
{
   echo ""
   echo "Eg: sh change_instances.sh -a https://root.ithena.net/usr/ -b nomorework"
   echo "Usage: $0 -a"
   echo -e "\t-a URL of the project"
   echo -e "\t-b Enter reset deatch update suspend resume nomorework allowmorework or detach"
       exit 1 # Exit script after printing help
}

while getopts "a:b:" opt
do
   case "$opt" in
      a ) project_url="$OPTARG" ;;
      b ) operation="$OPTARG" ;;

      ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
   esac
done

# Print helpFunction in case parameters are empty
if [ -z "$project_url" ] || [ -z "$operation" ]
then
   echo "Some or all of the parameters are empty";
   helpFunction
fi

n=100;
max=150;
while [ "$n" -le "$max" ]; do
#    key=$(head -c 32 "/usr/bin/multiboinc/BOINC_$n/gui_rpc_auth.cfg"


   echo "$project_url BOINC_$n"
/usr/bin/boinccmd --host localhost:"50$n" --passwd "password"  --project "$project_url"  "$operation";
   n=`expr "$n" + 1`;
done


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA