It is currently Wed May 22, 2013 5:07 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Tired of forgetting that you stopped FAH on your linux box?
PostPosted: Mon Apr 12, 2004 8:09 pm 
Offline
Friend of SPCR

Joined: Sun Mar 21, 2004 5:47 pm
Posts: 867
Location: Phoenix, AZ
Ok, I might be the only one, but I decided I may as well post this just in case it will help others. I mainly do all my general stuff such as email, web surfing, photoediting, etc. on my Windows server. I have a couple linux machines running FAH however. I don't have it set up as a service since I don't want it to automatically startup on boot. As such, I usually just manually start it as a regular user after booting each system since I don't reboot very often. Every so often I'll stop the service to do other testing, or boot the server and forget to start FAH.

Here's where it gets misleading. I run F@H LogStats on my Windows system to monitor the progress of my servers. It automatically pulls the log on the local windows system as well as the two linux servers. Unfortunately, it doesn't actually tell you if FAH is running or not. If FAH is stopped on one of the linux servers, it still pulls the log and just reports that it's XX% complete, frame time of 6:31, time left of 07:13:23 for example, even if FAH isn't running. Since I don't usually watch the actual values too closely, this means that I'm blisfully unaware of the lack of progress on a stopped server for potentially hours or even days at a time. It simply continues to state it's frame time of X minutes per frame, and X hours until completion.

What to do? Well the one thing that LogStats will do that's useful is that if the log file is blank, it will assume it's no longer active and remove that client from your list of reporting clients. So it would seem our solution is the monitor to see if FAH is running on the linux servers and just blank out the file if it's not running. Actually, what I decided to do is that if it's not running to append the contents of the FAHlog.txt file to FAHlog-Prev.txt before setting the contents of FAHlog.txt to null. Here's the script I wrote.

Quote:
#!/usr/bin/perl
#fahmon # Monitors to see if FAH is running or not
# If not running, append FAHlog.txt to FAHlog-Prev.txt and blank FAHlog.txt

$foldingdir="/opt/folding"; # Directory where you have Folding at Home installed

$psoutput=`ps -ef | grep -v grep | grep -c FAH4Console-Linux.exe`; chomp $psoutput;
if ($psoutput lt "1") {
system("cat $foldingdir/FAHlog.txt >> $foldingdir/FAHlog-Prev.txt");
system("cat /dev/null > $foldingdir/FAHlog.txt");
}

exit;


I named it fahmon, but you can call it whatever you want. Since the log files should always be named FAHlog.txt and FAHlog-Prev.txt the only thing that changes is the installed directory. As such, I made the installed directory a variable at the top of the script. You would just set that to whatever the path is to your installation of FAH. Since linux doesn't support HyperThreading, chances are most folks running linux aren't running more than one copy. If you have a multi-CPU linux/unix server, well, then you're probably smart enough to figure out how to make it work based on the fact I'm using grep to count the number of times FAH4Console is present in the ps output and take it from there.

The only other component is to throw a line in crontab so it runs automatically. I use this entry:

0,10,20,30,40,50 * * * * /opt/folding/fahmon >/dev/null 2>&1

which means it will check every 10 minutes to see if FAH is running, and if not, it springs in to action. The next time LogStats pulls the log, it will be blank and think the client is no longer active, thus removing it from my short summary page. Since I only have 3 servers total, seeing my list drop from 3 to 2 is an instant tip-off that I may have forgotten to restart FAH on one of the boxes. Alternatively, if you're sitting on the overview page, it gives a numerical list of how many clients you have working, so this too can be a good way to monitor how many you have active and decide if that's correct for you or not.

_________________
Phenom 1090T / 9800GTX+ / Antec P180 / Seasonic S12-600


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 8:33 pm 
Offline
Patron of SPCR

Joined: Fri Aug 29, 2003 11:09 pm
Posts: 2425
Location: Earth
AZBrandon wrote:
Since linux doesn't support HyperThreading

I believe recent kernels do.

This issue of LogStats not showing which clients are actually ACTIVE is one reason I still run EMIII. This feature is high on my wishlist for LogStats.

David

_________________
Join SPCR's Folding Team! <-- Click Here


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 8:49 pm 
Offline
Friend of SPCR

Joined: Sun Mar 21, 2004 5:47 pm
Posts: 867
Location: Phoenix, AZ
I couldn't get EMIII to work, but I guess I could try again. It looked interesting... if I could make it do anything. The documentation on the web site was.. uh.. well non-existant actually. Anyway, at least until I have time to play with EMIII again I at least have a workaround for LogStats.

_________________
Phenom 1090T / 9800GTX+ / Antec P180 / Seasonic S12-600


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 9:17 pm 
Offline
Patron of SPCR

Joined: Fri Sep 26, 2003 5:26 pm
Posts: 659
Location: Palm Springs, CA, USA
EM is the way to go if you're trying to keep track of what's going on with your folders. Several of my boxes/open-air boards have no kybrd, mouse or monitor and sometimes they'll go a little wonky when the kybrd/mouse are plugged in/unplugged whilst running.

I had some trouble getting EM to run at first and gave up. Then, a few weeks ago I tried it again and got it going. May have been some sort of goofy problem with my wired network at home, but, works now on all but one box (something tangled up in the registry, it says.) It's a little easier to keep up with what's going on if you map the drive on each folder.

Don't know how to link up with a linux box. Pretty sure David knows?

M


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 9:18 pm 
Offline
Patron of SPCR

Joined: Fri Aug 29, 2003 11:09 pm
Posts: 2425
Location: Earth
AZBrandon wrote:
I couldn't get EMIII to work, but I guess I could try again. It looked interesting... if I could make it do anything. The documentation on the web site was.. uh.. well non-existant actually. Anyway, at least until I have time to play with EMIII again I at least have a workaround for LogStats.

Oh, I quite agree. LogStats is drop-dead easy to set up. EMIII is...quirky. The default EMIII skin is fugly, but TRC-13 made a SPCR skin which is quite nice. I need to find the link to it and post it along with the EMIII info in the Links thread.

David

_________________
Join SPCR's Folding Team! <-- Click Here


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 9:23 pm 
Offline
Patron of SPCR

Joined: Fri Aug 29, 2003 11:09 pm
Posts: 2425
Location: Earth
Here was TRC-13's original post containing the link to the skin, but the link no longer works. :(

David

_________________
Join SPCR's Folding Team! <-- Click Here


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 12, 2004 11:02 pm 
Offline
Patron of SPCR

Joined: Fri Aug 29, 2003 11:09 pm
Posts: 2425
Location: Earth
mas92264 wrote:
Don't know how to link up with a linux box. Pretty sure David knows?

Samba.

David

_________________
Join SPCR's Folding Team! <-- Click Here


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group