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.