Subject: program can set "utmp" at startup, but can't update it at exit
To: None <port-i386@netbsd.org>
From: Henry Nelson <henry@irm.nara.kindai.ac.jp>
List: port-i386
Date: 12/06/2000 10:49:54
I'm using an application which opens a new login shell to run in.  It
runs as root.  It makes an entry for a new user in utmp, but when the
user exits the shell and quits the application, it cannot properly reset
utmp.  Any users which run the application have an entry left even if
they log off the machine (according to `who`).  The only way to get
rid of the entries seems to be to reboot the machine.

What it seems to be doing is erasing the parent shell's entry and
leaving the child shell's entry:

   immediately after logging in:
tx97% who
henry    ttyp0    Dec  6 09:43  (192.168.10.49)
   start program, and from it's child shell:
tx97% who
henry    ttyp1    Dec  6 09:45  (ttyp0)
   exit child shell (=quit program):
tx97% who
henry    ttyp1    Dec  6 09:45  (ttyp0)
   after logging off the system, and then logging in again:
tx97% who
henry    ttyp0    Dec  6 09:50  (192.168.10.49)
henry    ttyp1    Dec  6 09:45  (ttyp0)
   *OR* not logging off, but logging in from another terminal:
tx97% who
henry    ttyp1    Dec  6 10:06  (192.168.10.52)

The "ttyp1" entry remains until the machine is rebooted, or it is
allocated to a new login if it's not active.  While `who` doesn't
seem to know about "ttyp0," login seems to know that it is being
used.

Can anyone give me some pointers as to what part of the code I should
check to find the solution to this problem?  TIA.

henry nelson