PDA

View Full Version : DF and linux problems Part 2



freeiso
02-27-2003, 11:27 PM
hi again its me

i have a new problem, i want to cron foldit
what i have so far is this

if
ls /fold-fat/distribfold/foldtrajlite.lock >nul
/fold-fat/distribfold/foldit
goto end
else
:End

will that work of i put it in
cron.hourly
yes i'm using RH
:help:
ty

rshepard
02-27-2003, 11:46 PM
Hmmmm--
Are you wanting to do an hourly check to see if foldit is running?
if so, couldn't you just issue the ./fold-fat/distribfold/foldit command hourly, or is it going to start multiple instances? If it recognizes the process is already running, it would be simpler.

freeiso
02-27-2003, 11:57 PM
i want to check if running and if it is do nothing
else start foldit
every hour

rshepard
02-28-2003, 12:04 AM
How 'bout this


#!/bin/bash
if test -f /fold-fat/distribfold/foldtrajlite.lock
then
# file exists, so start foldit.
/fold-fat/distribfold/foldit

else
# file does NOT exist, so do nothing.

exit
fi


Stole that off a website and modified it for your conditions (I hope)

freeiso
02-28-2003, 01:01 AM
seems to have worked

only time will tell

ty

now i only need to get my linux box connected to the www and i'm good to go
:|ot|:

Hua Luo Han
03-17-2003, 08:19 AM
Originally posted by freeiso
seems to have worked

only time will tell

ty

now i only need to get my linux box connected to the www and i'm good to go
:|ot|:

I'm new to DF with Linux, just asking how do you tell if foldit is running ? Cos there are no graphical indication....... :confused:

rshepard
03-17-2003, 08:36 AM
one way would be to open a terminal and run the "top" command- foldit should be using the bulk of the cpu

cygnussphere
03-17-2003, 09:04 AM
Originally posted by Hua Luo Han
I'm new to DF with Linux, just asking how do you tell if foldit is running ? Cos there are no graphical indication....... :confused:

Also you can use this
http://www.free-dc.org/forum/showthread.php?s=&threadid=2433&highlight=linux+benchmark

or this
http://www.free-dc.org/forum/showthread.php?s=&threadid=2522&highlight=linux+dfgui

:cheers:

IronBits
03-17-2003, 09:14 AM
open a command shell, cd to where the client is working.
cat progress.txt ... wait a couple of seconds
cat progress.txt ... you will see a difference in the output. ;)

Hua Luo Han
03-17-2003, 09:39 AM
Thanks guys !!! BTW what diff between the gcc and intel compiler version of linux text clent as seen on the df download page ?:confused:

IronBits
03-17-2003, 09:41 AM
IC is faster than the gcc I believe.

bwkaz
03-23-2003, 03:48 PM
Originally posted by rshepard, edited a bit by me

#!/bin/bash
if test -f /fold-fat/distribfold/foldtrajlite.lock
then
# file exists, so start foldit.
/fold-fat/distribfold/foldit
fi

# If file does NOT exist, this will do nothing, as long as the script ends here. Shouldn't you only be starting the client if foldtrajlite.lock does not exist? :confused:

If so, something like this might be better:


#!/bin/bash

if ! [ -f /fold-fat/distribfold/foldrajlite.lock ] ; then
cd /fold-fat/distribfold
./foldit
fi Couple of other things with this: The foldit script doesn't work unless the current directory is the one that holds the script. With cron, I believe the current directory is your home, but of course I could be wrong. I used [ ... ] as a shorthand for test. The ! negates the test condition. I've also put the then on the same line as the if -- this is another shorthand.

rshepard
03-23-2003, 04:20 PM
Shouldn't you only be starting the client if foldtrajlite.lock does not exist?

You may be correct-- I'm not running the DF client, so I don't know if the lock is associated with a running client or one that has halted. my impression from the original question was that it is the latter...

ECL
03-23-2003, 08:21 PM
The lock file is created by the client when it executes and is supposed to prevent another instance from starting. The client will remove the lock file when it shuts down. The lock file can occasionally get left behind if the client is killed abruptly, or if the lock file's permissions get changed (touched by root, for instance).

In any case, if a lock file exists, you don't want to start the client - check for an existing instance. If there isn't one, you can whack the lock file and start up.