Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* VERY low-level question
@ 1995-06-29  4:00 Phil Edwards
  0 siblings, 0 replies; only message in thread
From: Phil Edwards @ 1995-06-29  4:00 UTC (permalink / raw)



(Followups set to reply by mail to me; I'll post a summary of any
 good information.)


The utmp.h file on OSF/1 3.0 #defines ten different values for the
ut_type member of the utmp structure, namely:

#define EMPTY           0
#define RUN_LVL         1
#define BOOT_TIME       2
#define OLD_TIME        3
#define NEW_TIME        4
#define INIT_PROCESS    5       /* Process spawned by "init" */
#define LOGIN_PROCESS   6       /* A "getty" process waiting for login */
#define USER_PROCESS    7       /* A user process */
#define DEAD_PROCESS    8
#define ACCOUNTING      9


I need to figure out what the ut_type is set to when a user logs
out.  On Linux, it's DEAD_PROCESS, but then Linux doesn't even
define a value for zero.  I've been trying to write some code that
would go through the utmp file and do a formatted dump of the
entries, but I have yet to succeed (plagued with stupid mistakes and
not very much time).

The end question is:  if I have just forcibly logged somebody out
(via untamo) and I wish to make certain that the utmp entry hasn't
been corrupted, what do I need to set in order to let the system
know that such-and-such a tty is free for use again?  I am assuming
that the ut_type is the only thing I need to set.

We have varying types of connections (LAT ports, ptys, etc), and
it's my understanding that different connections might need to get a
different "all-clear, this is unused" ut_type set.  Unfortunately,
I'm rather new at this part of it:  detecting which type of
connection is no problem (check the ut_line string), but I don't
know what the new ut_type would need to be.

(This code will also be used to manually clear a utmp entry when a
user logs out "ungracefully" and leaves the dead entry behind,
racking up fake "idle time".)

Any advice or suggestions you might have are welcome.  Please reply
by mail and I'll try to post a summary.


-- 
Phil Edwards       #include<std/disclaimer.h>       pedwards@cs.wright.edu
http://www.cs.wright.edu/people/students/pedwards/
The gods do not protect fools.  Fools are protected by more capable fools.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-06-29  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-06-29  4:00 VERY low-level question Phil Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox