A while ago I wrote a short script that would kill the F@H process without having to do it manually by finding the PID and so on. Since I've been running F@H I have noticed a performance hit - especially with graphic intensive programs, so I figured out a way to 1: kill F@H when I log in, and 2: start it back up again when I log out.
First the scripts. This one will start the processes (this is for a dual G4 BTW):
Code:
# begin script
#!/bin/sh
# kick off folding@home:
# processor 2:
cd /path/to/fah/
./fah4 -local -forceasm &
# processor 1:
cd /path/to/fah1/
./fah4 -local -forceasm &
# end script
now the kill script:
Code:
# begin script:
#!/bin/sh
# kill off folding@home processes:
killall FahCore_78.exe
killall FahCore_65.exe
echo 'fah processes stopped.'
# end script
(ok, crude but effective
)
Now to activate fah on logout, and kill it on login:
1- make a copy of /etc/ttys
2- open ttys and find the line that begins with:
console "/System/Library/CoreServices/loginwindow.app..."
3- change it to read:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LoginHook /path/to/fah/kill/script -LogoutHook /path/to/fah/startup/script" vt100 on secure onoption="/usr/libexec/getty std.9600"
the only parts that changed were the -LoginHook and -LogoutHook pieces, everything else in that line will stay.
4- before it would work for me i had to reboot.
Hope someone can use this!