Page 1 of 1

Is finstall still being maintained?

Posted: Fri Apr 18, 2008 10:42 am
by P5-133XL
I just tried installing with finstall and noticed that it didn't work. Specificly, the (SMP) url's and file names are no longer valid. I edited them to point to the correct location and it then worked just fine.

Re: Is finstall still being maintained?

Posted: Fri Apr 18, 2008 11:31 am
by Ivoshiee
I still update the finstall script and I haven't noticed anything wrong.
Just report what is wrong and I will fix it.

Re: Is finstall still being maintained?

Posted: Fri Apr 18, 2008 12:25 pm
by P5-133XL
Old version:

Fclient_linuxA_SMP_Fdwnl=http://folding.stanford.edu/release/
Fclient_linuxA_SMP=FAH_SMP_Linux.tgz
Fclient_linuxA_SMP_name=fah5

new version:

Fclient_linuxA_SMP_Fdwnl=http://www.stanford.edu/group/pandegrou ... g/release/
Fclient_linuxA_SMP=FAH6.02beta1-Linux.tgz
Fclient_linuxA_SMP_name=fah6

With those small changes, it seems to work correctly to install the Linux SMP client

Re: Is finstall still being maintained?

Posted: Fri Apr 18, 2008 12:59 pm
by Ivoshiee
P5-133XL wrote:Old version:

Fclient_linuxA_SMP_Fdwnl=http://folding.stanford.edu/release/
Fclient_linuxA_SMP=FAH_SMP_Linux.tgz
Fclient_linuxA_SMP_name=fah5

new version:

Fclient_linuxA_SMP_Fdwnl=http://www.stanford.edu/group/pandegrou ... g/release/
Fclient_linuxA_SMP=FAH6.02beta1-Linux.tgz
Fclient_linuxA_SMP_name=fah6

With those small changes, it seems to work correctly to install the Linux SMP client
Thanks, it is fixed.

Re: Is finstall still being maintained?

Posted: Sat May 03, 2008 10:41 pm
by smoking2000
Ivoshiee wrote:Thanks, it is fixed.
I've got fix for you too, on OpenBSD 4.3 (which was recently released, and for which I wrote a F@H related HOWTO) the code added to /etc/rc.{local,shutdown} by the installService script throws an error:

Code: Select all

root@vmware-openbsd:~# tail -3 /etc/rc.local /etc/rc.shutdown
==> /etc/rc.local <==
#Start up Folding@Home Service
echo "Starting Folding@Home Service..."
su folding -c "/home/folding/foldingathome/folding start"

==> /etc/rc.shutdown <==
su folding -c "/home/folding/foldingathome/folding stop"
echo "Sleeping 20 seconds to allow Folding@Home service time to shut down properly..."
sleep 20
root@vmware-openbsd:~# su folding -c "/home/folding/foldingathome/folding start"
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

['folding' ver. 5.9]

Starting up FAH client(s) on 1 processor(s):
Starting FAH client at CPU1...
FAH client #1 startup: OK

^C
root@vmware-openbsd:~# su - folding -c "/home/folding/foldingathome/folding start"

['folding' ver. 5.9]

Starting up FAH client(s) on 1 processor(s):
Starting FAH client at CPU1...
FAH client #1 startup: OK

^C
The installScript is not using a login shell, so the environment is not what is expected. From the su man page:

Code: Select all

     -       Same as the -l option (deprecated).

[...]

     -l      Simulate a full login.  The environment is discarded except for
             HOME, SHELL, PATH, TERM, LOGNAME, and USER.  HOME and SHELL are
             modified as above.  LOGNAME and USER are set to the target login.
             PATH is set to the value specified by the ``path'' entry in
             login.conf(5).  TERM is imported from your current environment.
             The invoked shell is the target login's, and su will change di-
             rectory to the target login's home directory.
The patch to fix this is quite simple:

Code: Select all

--- finstall-orig       2008-05-04 00:24:47.000000000 +0200
+++ finstall    2008-05-04 00:25:48.000000000 +0200
@@ -2551,12 +2551,12 @@
 cat >> /etc/rc.local << $terminator
 #Start up Folding@Home Service
 echo "Starting Folding@Home Service..."
-su \$USERNAME -c "\$Fpath/folding start"
+su - \$USERNAME -c "\$Fpath/folding start"
 $terminator

 cat >> /etc/rc.shutdown << $terminator
 #Shut down Folding@Home Service
-su \$USERNAME -c "\$Fpath/folding stop"
+su - \$USERNAME -c "\$Fpath/folding stop"
 echo "Sleeping 20 seconds to allow Folding@Home service time to shut down properly..."
 sleep 20
 $terminator
A fully patched finstall file is also available.

Re: Is finstall still being maintained?

Posted: Mon May 05, 2008 7:26 am
by Ivoshiee
Another excellent contribution!
Finstall is fixed and released as 6.0.

Re: Is finstall still being maintained?

Posted: Wed Jan 21, 2009 12:52 am
by smoking2000
I've got another patch for you, it adds support for Arch Linux which uses BSD style init:

Code: Select all

--- finstall-orig       2009-01-21 00:54:57.000000000 +0100
+++ finstall    2009-01-21 01:42:56.000000000 +0100
@@ -2314,6 +2314,12 @@
 # To get to know more about FAH go to http://folding.stanford.edu.

 StartDir="/etc/init.d"
+# Arch Linux uses /etc/rc.d/ for init scripts, and DAEMONS
+# in /etc/rc.conf specifies which services to start at boot
+if [ -r /etc/arch-release ]
+ then
+  StartDir="/etc/rc.d"
+fi
 Fpath="$Fdir"
 #tr utility will be used if it is available:
 tr_OK=$tr_OK
@@ -2412,6 +2418,16 @@
  then
 #Debian specific:
   update-rc.d folding defaults
+elif [ -e /etc/arch-release ];
+ then
+#Arch specific:
+  if [ \$(egrep "^DAEMONS=(.*?\s*[!|@]?folding\s*.*?)" /etc/rc.conf | wc -l) == 0 ]
+   then
+# folding is not yet added to DAEMONS in /etc/rc.conf
+    cp /etc/rc.conf /etc/rc.conf.folding-bak
+    sed -r 's/^\s*DAEMONS=\((.*?)\)/DAEMONS=\(\1 folding\)/' /etc/rc.conf > /etc/rc.conf.new
+    mv /etc/rc.conf.new /etc/rc.conf
+  fi
  else
 #All other Linux distros:
   chkconfig --add folding
@@ -2457,6 +2473,11 @@
 # To get to know more about FAH go to http://folding.stanford.edu.

 StartDir="/etc/init.d"
+# Arch Linux uses /etc/rc.d/ for init scripts
+if [ -r /etc/arch-release ]
+ then
+  StartDir="/etc/rc.d"
+fi

 UseSudo=false
 # Several Linux distros these days use sudo instead of a separate root account,
@@ -2512,6 +2533,16 @@
  then
 #Debian specific:
   update-rc.d -f folding remove
+elif [ -e /etc/arch-release ];
+ then
+#Arch specific:
+  if [ \$(egrep "^DAEMONS=(.*?\s*[\!|@]?folding\s*.*?)" /etc/rc.conf | wc -l) == 1 ]
+   then
+# folding is added to DAEMONS in /etc/rc.conf
+    cp /etc/rc.conf /etc/rc.conf.folding-bak2
+    sed -r 's/^DAEMONS=\((.*?)\s*[!|@]?folding\s*(.*?)\)/DAEMONS=\(\1\2\)/' /etc/rc.conf > /etc/rc.conf.new
+    mv /etc/rc.conf.new /etc/rc.conf
+  fi
  else
 #All other Linux distros:
   chkconfig --del folding
archlinux.patch | finstall

Re: Is finstall still being maintained?

Posted: Wed Jan 21, 2009 6:45 am
by Ivoshiee
smoking2000 wrote:I've got another patch for you, it adds support for Arch Linux which uses BSD style init:

Code: Select all

--- finstall-orig       2009-01-21 00:54:57.000000000 +0100
+++ finstall    2009-01-21 01:42:56.000000000 +0100
@@ -2314,6 +2314,12 @@
 # To get to know more about FAH go to http://folding.stanford.edu.

 StartDir="/etc/init.d"
+# Arch Linux uses /etc/rc.d/ for init scripts, and DAEMONS
+# in /etc/rc.conf specifies which services to start at boot
+if [ -r /etc/arch-release ]
+ then
+  StartDir="/etc/rc.d"
+fi
 Fpath="$Fdir"
 #tr utility will be used if it is available:
 tr_OK=$tr_OK
@@ -2412,6 +2418,16 @@
  then
 #Debian specific:
   update-rc.d folding defaults
+elif [ -e /etc/arch-release ];
+ then
+#Arch specific:
+  if [ \$(egrep "^DAEMONS=(.*?\s*[!|@]?folding\s*.*?)" /etc/rc.conf | wc -l) == 0 ]
+   then
+# folding is not yet added to DAEMONS in /etc/rc.conf
+    cp /etc/rc.conf /etc/rc.conf.folding-bak
+    sed -r 's/^\s*DAEMONS=\((.*?)\)/DAEMONS=\(\1 folding\)/' /etc/rc.conf > /etc/rc.conf.new
+    mv /etc/rc.conf.new /etc/rc.conf
+  fi
  else
 #All other Linux distros:
   chkconfig --add folding
@@ -2457,6 +2473,11 @@
 # To get to know more about FAH go to http://folding.stanford.edu.

 StartDir="/etc/init.d"
+# Arch Linux uses /etc/rc.d/ for init scripts
+if [ -r /etc/arch-release ]
+ then
+  StartDir="/etc/rc.d"
+fi

 UseSudo=false
 # Several Linux distros these days use sudo instead of a separate root account,
@@ -2512,6 +2533,16 @@
  then
 #Debian specific:
   update-rc.d -f folding remove
+elif [ -e /etc/arch-release ];
+ then
+#Arch specific:
+  if [ \$(egrep "^DAEMONS=(.*?\s*[\!|@]?folding\s*.*?)" /etc/rc.conf | wc -l) == 1 ]
+   then
+# folding is added to DAEMONS in /etc/rc.conf
+    cp /etc/rc.conf /etc/rc.conf.folding-bak2
+    sed -r 's/^DAEMONS=\((.*?)\s*[!|@]?folding\s*(.*?)\)/DAEMONS=\(\1\2\)/' /etc/rc.conf > /etc/rc.conf.new
+    mv /etc/rc.conf.new /etc/rc.conf
+  fi
  else
 #All other Linux distros:
   chkconfig --del folding
archlinux.patch | finstall
Thanks, I'll implement it and some other changes as well.

Re: Is finstall still being maintained?

Posted: Sat Feb 07, 2009 10:44 pm
by Ivoshiee
It took some time (and failed long wait for a new FAH client), but I've updated the finstall script.
I wonder why egrep does trigger an error when to run installService. It should not get run at the first place.

Code: Select all

[ivo@haskaa foldingathome]$ ./installService 
Installing FAH as a service...

'/etc/init.d/folding' is present.
Do You want to reinstall it?: y
egrep: /etc/rc.conf: No such file or directory
Password: 
[ivo@haskaa foldingathome]$ 

Code: Select all

#!/bin/bash
# This is FAH ("Folding At Home") service installation script.
# To get to know more about FAH go to http://folding.stanford.edu.

StartDir="/etc/init.d"
# Arch Linux uses /etc/rc.d/ for init scripts, and DAEMONS
# in /etc/rc.conf specifies which services to start at boot
if [ -r /etc/arch-release ]
 then
  StartDir="/etc/rc.d"
fi
Fpath="/home/ivo/folding2/foldingathome"
#tr utility will be used if it is available:
tr_OK=true

UseSudo=false
# Several Linux distros these days use sudo instead of a separate root account,
# use of the su command is only allowed to the root user or users who use sudo.
# So for finstall to work, it has to use sudo to run the su command or the it
# will not be allowed.
#
# The LSB specifies two ways to find out which distro your program is run on.
# The file /etc/lsb-release, and the program /usr/bin/lsb_release.
# The program is the only thing specified in the standard, so the file may be 
# missing even on LSB conforming distros.
# 
# See also: 
# http://lists.freestandards.org/pipermail/lsb-discuss/2004-May/002143.html
# http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/lsbrelease.html
#
# Check for /etc/lsb-release and inside it for distribution name
#
# $ cat /etc/lsb-release
# DISTRIB_ID=Ubuntu
# DISTRIB_RELEASE=6.06
# DISTRIB_CODENAME=dapper
# DISTRIB_DESCRIPTION="Ubuntu 6.06.1 LTS"
if [ -r /etc/lsb-release ]
 then
# using Ubuntu?
  ret=$(grep DISTRIB_ID /etc/lsb-release | sed 's/^\w*=//')
  if [ "X$ret" == "XUbuntu" ]
   then
    UseSudo=true
  fi
elif [ -x /bin/lsb_release ]
 then
# using Ubuntu?
  ret=$(/bin/lsb_release --id | sed 's/^Distributor ID:\t//')
  if [ "X$ret" == "XUbuntu" ]
   then
    UseSudo=true
  fi
elif [ -x /usr/bin/lsb_release ]
 then
# using Ubuntu?
  ret=$(/usr/bin/lsb_release --id | sed 's/^Distributor ID:\t//')
  if [ "X$ret" == "XUbuntu" ]
   then
    UseSudo=true
  fi
fi

AskChoice(){
#Ask for y/n type choice.
#Input: $Message
#Output: $Answer
local answerOK
local input_count

input_count=0
answerOK="false"
while [ "$answerOK" = "false" ]
 do
  if [ $input_count -gt 9 ];
   then
    echo
    echo CANCELLED!
    echo
    exit 1
  fi
                             
  echo -n "$Message"
  read Answer

  if [ "$tr_OK" = "true" ]
   then
    Answer=$(echo $(echo "$Answer" | tr A-Z a-z))
  fi
  if [ "$Answer" = "yes"  -o  "$Answer" = "y"  -o   "$Answer" = "no"  -o "$Answer" = "n" ]
   then
    answerOK="true"
  fi

  let "input_count=input_count+1"
 done
}
ServiceInstall(){
cat << EOF
#!/bin/bash
if [ -w ${StartDir}/folding ];
 then
  rm -f ${StartDir}/folding
fi  
cp ${Fpath}/folding ${StartDir}/
if [ -e /etc/debian_version ]; 
 then
#Debian specific:
  update-rc.d folding defaults
 elif [ -e /etc/arch-release ];
  then
#Arch Linux specific:
   if [ $(egrep "^DAEMONS=(.*?\s*[!|@]?folding\s*.*?)" /etc/rc.conf | wc -l) == 0 ]
    then
# folding is not yet added to DAEMONS in /etc/rc.conf
     cp /etc/rc.conf /etc/rc.conf.folding-bak
     sed -r 's/^\s*DAEMONS=\((.*?)\)/DAEMONS=\(\1 folding\)/' /etc/rc.conf > /etc/rc.conf.new
     mv /etc/rc.conf.new /etc/rc.conf
   fi
 else
#All other Linux distros:
  chkconfig --add folding
fi 
EOF
}
echo "Installing FAH as a service..."
echo ""
if [ -r ${StartDir}/folding ];
 then
  echo "'${StartDir}/folding' is present."
  Message="Do You want to reinstall it?: "
  AskChoice
  if [ "$Answer" = "n" -o "$Answer" = "no" ];
   then 
    exit
  fi 
fi

# When running on Ubuntu use sudo, because su is not available to normal users
if [ $UseSudo == true ]
 then
  sudo su - -c "$(ServiceInstall)"
 else
  su - -c "$(ServiceInstall)"
fi

#END

Re: Is finstall still being maintained?

Posted: Sun Feb 08, 2009 5:01 am
by ikerekes
May I suggest that you download qfix as well with qd?

Re: Is finstall still being maintained?

Posted: Sun Feb 08, 2009 10:37 am
by smoking2000
Ivoshiee wrote:It took some time (and failed long wait for a new FAH client), but I've updated the finstall script.
I wonder why egrep does trigger an error when to run installService. It should not get run at the first place.
It's probably the use of a sub shell ($()) which might by evaluated always even when it's in a condition which is never triggered, you can try replacing it with backticks.