[RC5] Checkpoint file

Peter Cordes peter at llama.nslug.ns.ca
Sun Oct 28 21:58:53 EST 2001


On Thu, Oct 25, 2001 at 03:02:23AM +0200, Dennis Lubert wrote:
> mh, well can this be done with the -ini option ? mh, I will look if theres 
> an option for checkpoint files, because its not fun to set up 138 different 
> ini files... I use a script to start them all via ssh, so I could use the 
> hostname as name for the checkpoint file, that should be unique

 Did you ever figure out a solution?  If the machines are all the same
(so they use the same core, at least), any of them will be able to continue
work units done by any others.  As others have said, you don't need
checkpoints at all if they get shut down cleanly.  (i.e. send a sigterm, as
opposed to sigkill or something.)

 Since you're starting it over ssh, you probably have Unix.  Thus, it is
easy to write a shell script that checks $(hostname) to see if any hosts
need special treatment or alternate buffer files.  You can use command line
arguments to set e.g. log files, so you can have a separate log file for
every client.  I do this on the university workstation network.  This avoids
having a separate config file for every machine.  There are lots of cmdline
opts, so if you need to do something per-machine, do it that way.

 I use this from cron to keep tabs on the workstations:

 for i in $(cat "$mlist");do
         if ping $i 2|grep -v 'alive'; then continue;fi
         echo -n $i:
         rsh 2>&1 -n $i "~cordes/bin/dnetc.sh"
 done

 (mlist is a list of hostnames, and this is on Solaris, so ping is useful
for this.)

dnetc.sh looks like this:

#!/bin/bash

# dnetc.sh copyright Peter Cordes 1999.  License: GPL

dnet_dir=~/dnet
args="$* -quiet -l $dnet_dir/logs/$(hostname).log"
#args="$* -quiet"
pfile=/var/tmp/StopRC5.now  # created by login to CDE

if [ potato-head = $(hostname) ];then args="-frequent $args";fi
 
if [ -e "$pfile" ] && uptime | grep ' 0 users';then
        echo "pausefile exists but nobody is logged in; deleting it"
        ls -l "$pfile"
        rm -f "$pfile"
fi
			 
if ps -A | egrep 'dnetc$|rc5des$';  then exit ; fi
			 
($dnet_dir/dnetc $args &) < /dev/null &>/dev/null;
			 
echo started


 I get the email output from this every day.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at llama.nslug. , ns.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BCE
--
To unsubscribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net
rc5-digest subscribers replace rc5 with rc5-digest



More information about the rc5 mailing list