Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Community > Team MacNN > F@H startup and kill scripts... activate either at login or logout

F@H startup and kill scripts... activate either at login or logout
Thread Tools
hotani
Senior User
Join Date: Sep 2000
Location: Denver, CO, USA
Status: Offline
Reply With Quote
Jul 29, 2004, 10:31 AM
 
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!
// hōtani
MDD G4 dual 867
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:07 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,