Subject: Re: utmpx.h
To: Christos Zoulas <christos@zoulas.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 09/24/2001 14:01:39
>| >| Exit codes and PIDs are VERY good (xref to process accounting, check for
>| >| status, etc.).  I've missed both of these every time I've migrated a
>| >| system with session accounting from SysV to *BSD.
>| >
>| >Pid is easy and might be useful. Who is responsible for writing out the
>| >exit code? And how can that be done reliably?
>| 
>| presumably the thing that writes out the "close" record is doing so
>| because some process has exited...no?  that's gonna be ftpd, telnetd,
>| rlogind, sshd, or init, right?  i imagine that's about as reliable as
>| anything.
>
>Not always. Consider the scenario where I have in my .xinitrc
>
>xterm &
>exec twm
>
>or
>
>xterm &
>twm &
>wait
>
>I don't expect twm or the shell to clean up utmp records...

since they don't place utmp records currently (do they?), i wouldn't
expect them to, either.  xterm, on the other hand, does (if you use
-ls, at least), so when the shell exits, it ought to write out a
"close" record.  which it does.

>And it is not just xterm; I could be running screen, and decided to kill -9
>it.

...which strikes me as being just as "reliable" as the current utmp
method, no?  if i log in and kill the thing that allowed me to log in,
i'm shooting myself in the foot anyway.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."