Click to See Complete Forum and Search --> : Starting FAH in Ubuntu at startup
I created a file at /etc/init.d/foldingathome that says this:
#!/bin/bash
pushd /home/user/FAH/
screen -d -m 'su user -c "./FAH502-Linux.exe"'
popd
I added the following symlink:
sudo ln -s /etc/init.d/foldingathome /etc/rc2.d/S99foldingathome
I reboot and it doesn't work. As far as I can tell it's a problem with the screen commands but that's how I interepreted the screen man.
Oh I used this link as an example for getting started:
http://www.ubuntuforums.org/showthread.php?t=3242&highlight=folding
retsaw
01-20-2005, 05:46 AM
Do you need to use screen? FAH creates a log file which you can use to check it's progress. Though I tested the screen command and it does work. Have you done a "chmod +x" on your script?
Note that you will need to put the screen within the "su -c" to be able to attach to it as a user and not root. e.g. su user -c "screen -d -m ./FAH502-Linux.exe"
bwkaz
01-20-2005, 07:36 PM
Do you boot to runlevel 2 normally? Runlevels are not cumulative -- if you put the symlink in runlevel 2, but boot to runlevel 3, then the script won't be run.
The initdefault line in /etc/inittab specifies the default runlevel.
Runlevel 2 is the standard for Ubuntu apparently.
Retsaw, thanks, that worked. :) Now I feel bad for overtaking you in the FAH stats recently. :D I did have it chmoded correctly, but I did not have the command in the right order as you could see.
retsaw
01-21-2005, 05:37 PM
Originally posted by ions
Retsaw, thanks, that worked. :) Now I feel bad for overtaking you in the FAH stats recently. :D I did have it chmoded correctly, but I did not have the command in the right order as you could see.
Glad I could help. Now that you feel bad for overtaking me in the stats, you could give me one of your computers to help even it out ;)
Doh! You got back in front of me! One of my machines wasn't folding for a day but now that I have this working it shouldn't happen again.
techwise
01-22-2005, 11:05 PM
I think you need to run "update-rc.d" instead of adding the script manually to the rc folder.
put your script in init.d and make sure to set the x bit
then: "update-rc.d NAMEOFSCRIPT defaults 99"
m
A problem exists. When it reaches 100% on a WU it stops now. If I run it normally with the ./FAHblah.exe it does not behave like that. So something about starting FAH like this is no good. Any ideas?
retsaw
01-23-2005, 04:33 AM
Very strange, I don't know why that would be as I normally run it in a screen session, but started manually. Try usingsu user -c ./FAH502-Linux.exe >/dev/null 2>/dev/null &instead, that will redirect all displayed output to /dev/null and run it in the background, you can keep tabs on its progress by using tail on it's log files.
Originally posted by ions
Doh! You got back in front of me! One of my machines wasn't folding for a day but now that I have this working it shouldn't happen again.
:p
Using that line FAH does begin at startup but I won't know until it's completed a WU if it was succesful or not. Something is certainly up. I think I've missed 3-4 WUs because of this.