I created a system of tracking background processes.  I have a file PID,
which tracks everything. When a phantom is launched it updates itself in
the PID file via some routines I wrote to interact with this.  I have a
command that will show the status of all things in the PID file.  When
this command runs, it simply looks at the PID of said PHANTOM and it
checks in the OS (we are on Linux) to see if it is running.  There is
more to it, but this is the basic concept.

If you use 'LOCK' command, then you would use LIST.LOCKS to see if the
semaphore is locked (we are running Universe).  So I would say that this
is really like a 'common' structure.  There are 64 locks that can be
used this way in Universe.  We use these to ensure that a particular
process is running only once.  In our use of LOCKS we would do something
like LOCK 5;do some processing; UNLOCK 5 and quit.  However, if you use
this and the PHANTOM dies I think the lock is still set.  So this isnt a
real fool proof way of doing this.  

PORT.STATUS will let you know if a PHANTOM is running, but you either
have to be root or you have to change the permissions to allow you to
see this.

We have written our own batch processing system.  For whatever reason,
the batch processor dies on occassion.  Because this happens, I have a
cron job that runs every 5 minutes to check to see if the batch
processor is running (via the PID file) and if it sees that it is not
running, it kicks it off.

Anyway, when I was struggling with a similar problem, I decided to put
together our 'PID' tracking / control system.  It seems that all the
information is there for you to determine what you need to know.
However, it isnt presented in a way that you would like it to be.  So,
you will probably have to take this and write your own 'value added' way
of presenting what it is that you need.

Anthony

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Wolverton
Sent: Wednesday, December 28, 2005 12:56 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] [UD] BASIC "LOCK"s


Since we don't have Semaphore-like COMMON structures, I was going to use
the BASIC "LOCK" to know that a Phantom was running -- the lock missing
would tell me to start the process.

HOWEVER, if the phantom 'dies' - the documentation makes it read as if
the LOCK will stay engaged -- does anyone have practical knowledge if a
phantom falling over 'implies' an ECL QUIT?

I know I could use READU, but my understanding is that BASIC LOCKs use
far fewer resources to test - and as I will add a test for the Phantom
being 'up' in several common routines, I don't want to cause extra
bottlenecks.

(I really wish we had cross-process COMMON for things like this!)

Thanks -
David W.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date:
12/27/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date:
12/27/2005
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to