RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Anthony Dzikiewicz
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 LOCKs


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/


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Jacques G.
 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.

The Universe function GET.USERS will also let you know
if a phantom is running.  It also has the advantage
that it won't give you the message: Another
PORT.STATUS is running.  Some users can block
PORT.STATUS if they stay on the Hit a key to continue
message.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Anthony Dzikiewicz
I didn't know about GET.USERS.  I did a HELP GET.USERS, HELP BASIC
GET.USER and there was nothing.  Is this undocumented or is this a home
grown utility ?

Anthony

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Jacques G.
 Sent: Thursday, December 29, 2005 10:49 AM
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] [UD] BASIC LOCKs
 
 
  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.
 
 The Universe function GET.USERS will also let you know
 if a phantom is running.  It also has the advantage
 that it won't give you the message: Another
 PORT.STATUS is running.  Some users can block
 PORT.STATUS if they stay on the Hit a key to continue message.
 
 
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Jacques G.
It is part of Universe.  The source for that function
is in:

APP.PROGS  under the name: GET.USERS.B

Its parameters are:

 SUBROUTINE
GET.USERS(PI.USERS,MAX.PI.USERS,SYS.USERS,USER.INFO,
CODE) 


The variable USER.INFO can be exploited thus:

NB.US = DCOUNT(USER.INFO,@AM) ;* Number of users
FOR US = 1 TO NB.US
  PORT   = USER.INFOUS,1
  USERID = USER.INFOUS,2
  PID= USER.INFOUS,3
  TERM.TYPE = USER.INFOUS,4  ;* Terminal or Phantom
NEXT US

We asked UV support whether we could use SYSTEM(1302)
directly and were told we shouldn't as it isn't
documented yet.  

The GET.USERS function though can be used and will be
supported, there is just no garantee that in future
versions it will still use SYSTEM(1302) to feed it
though.

--- Anthony Dzikiewicz [EMAIL PROTECTED] wrote:

 I didn't know about GET.USERS.  I did a HELP
 GET.USERS, HELP BASIC
 GET.USER and there was nothing.  Is this
 undocumented or is this a home
 grown utility ?
 
 Anthony





__ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Dianne Ackerman
What version of Universe do you have that in?  I don't have it! (v9.6)
Thanks,
Dianne

Jacques G. wrote:

It is part of Universe.  The source for that function
is in:

APP.PROGS  under the name: GET.USERS.B

Its parameters are:

 SUBROUTINE
GET.USERS(PI.USERS,MAX.PI.USERS,SYS.USERS,USER.INFO,
CODE) 


The variable USER.INFO can be exploited thus:

NB.US = DCOUNT(USER.INFO,@AM) ;* Number of users
FOR US = 1 TO NB.US
  PORT   = USER.INFOUS,1
  USERID = USER.INFOUS,2
  PID= USER.INFOUS,3
  TERM.TYPE = USER.INFOUS,4  ;* Terminal or Phantom
NEXT US

We asked UV support whether we could use SYSTEM(1302)
directly and were told we shouldn't as it isn't
documented yet.  

The GET.USERS function though can be used and will be
supported, there is just no garantee that in future
versions it will still use SYSTEM(1302) to feed it
though.

--- Anthony Dzikiewicz [EMAIL PROTECTED] wrote:

  

I didn't know about GET.USERS.  I did a HELP
GET.USERS, HELP BASIC
GET.USER and there was nothing.  Is this
undocumented or is this a home
grown utility ?

Anthony





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


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread u2
The universe people provided a lot of undocumented and unsupported
programs in the APP.PROGS. GET.USERS.B is one of them. It's well worth
going through. There are sample user exits, and a program named EDT
that's a clone of the pick ED command, and lot of other good stuff.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Anthony Dzikiewicz
 Sent: Thursday, December 29, 2005 1:34 PM
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] [UD] BASIC LOCKs
 
 
 I didn't know about GET.USERS.  I did a HELP GET.USERS, HELP 
 BASIC GET.USER and there was nothing.  Is this undocumented 
 or is this a home grown utility ?
 
 Anthony
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Jacques G.
  Sent: Thursday, December 29, 2005 10:49 AM
  To: u2-users@listserver.u2ug.org
  Subject: RE: [U2] [UD] BASIC LOCKs
  
  
   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.
  
  The Universe function GET.USERS will also let you know
  if a phantom is running.  It also has the advantage
  that it won't give you the message: Another
  PORT.STATUS is running.  Some users can block
  PORT.STATUS if they stay on the Hit a key to continue message.
  
  
  
  
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around
  http://mail.yahoo.com 
  ---
  u2-users mailing list
  u2-users@listserver.u2ug.org
  To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Anthony Dzikiewicz
This is good info.
 
I did some experimenting with it and I found that on one Linux system
the loop thru the USER.INFO shows all process running and on the other
Linux system the same program shows only 'me'.  When I run this on the
Windows machine it show everything running.  So, on two machines it
contains almost the same info as PORT.STATUS and on one it doesnt.
However on that same machine that shows only 'me', a PORT.STATUS does
show everything ?

I guess when the Bishop came in, he forgot to bless one of the machines
?

Anthony

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


Re: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Jacques G.
The function is in APP.PROGS of 10.0.0 but we have a
client who has that version and it doesn't work on it.
 Our clients that have 10.1.xx versions have it and it
is functionnal there.

--- Dianne Ackerman [EMAIL PROTECTED] wrote:

 What version of Universe do you have that in?  I
 don't have it! (v9.6)
 Thanks,
 Dianne
 
 Jacques G. wrote:
 






__ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-29 Thread Jacques G.
 However on that same machine that shows only 'me', a
 PORT.STATUS does
 show everything ?

For PORT.STATUS it must have certain permission bits
set.  (+s if I remember correctly) otherwise it only
shows the jobs of the user running PORT.STATUS.

It's quite possible that whatever program is feeding
the info into SYSTEM(1302) also needs similar
permissions to be set.  

It might be possible to determine what that program is
by comparing the permissions of the uv executables of
the Linux system that displays it all versus the one
that does not.





__ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-28 Thread Chuck Mongiovi
David,
I don't currently use a READU on my UD system to LOCK phantoms, but I use it 
on UniVerse and it works unless you do an End Task on the UVSH process from 
the windows console .. Then you have to do some syntax of the UNLOCK command to 
fix things .. On my AIX machine, I use the listuser and ps commands to see if a 
phantom is actually still running .. This has it's quirks too ..

That being said, I tested a small phantom process and had it do a LOCK 1 
command and had it shutdown 3 ways without explicitly running a CLEAR.LOCKS 
command
1) normal exit (STOP)
2) deleteuser
3) input required

In all three cases, the LOCK went away .. I may start using this as a way to 
check that my phantoms are running ..

I know that UniVerse has similar LOCK syntax .. Does anyone else out there have 
any experience with LOCK and phantoms on UV?

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


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/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-28 Thread D Averch
When the phantom dies the semaphore lock get released.  We use this
mechanism for all of our background processes and it works like a champ.

Doug
www.u2logic.com

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

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/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-28 Thread David Wolverton
Thanks for doing those tests - I just thought someone would have already
done them and spout from memory! 

And really thanks for the validation - and I do think it bangs less on the
machine doing it this way.

But GOLLY I wish we had Cross-Process COMMON (and I wasn't even thinking of
MultiPlayer Games, Tony! g)

DW

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chuck Mongiovi
...
That being said, I tested a small phantom process and had it do a LOCK 1
command and had it shutdown 3 ways without explicitly running a CLEAR.LOCKS
command
1) normal exit (STOP)
2) deleteuser
3) input required

In all three cases, the LOCK went away .. I may start using this as a way
to check that my phantoms are running ..
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] [UD] BASIC LOCKs

2005-12-28 Thread Womack, Adrian
We use READU locks - they're much more friendly than semaphores as they can be
given meaningful names that show up with a LIST.READU.

Also they are very quick and easy to test with the RECORDLOCKED() function -
eg.

   IF NOT(RECORDLOCKED(filevar, recordname)) THEN ...

AdrianW







DISCLAIMER:
Disclaimer.  This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and delete
the e-mail and any attachments without using or disclosing the contents in any
way. The views expressed in this e-mail are those of the author, and do not
represent those of this company unless this is clearly indicated. You should
scan this e-mail and any attachments for viruses. This company accepts no
liability for any direct or indirect damage or loss resulting from the use of
any attachments to this e-mail.

[demime 1.01d removed an attachment of type application/ms-tnef which had a 
name of winmail.dat]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/