[prev in list] [next in list] [prev in thread] [next in thread] 

List:       shadow
Subject:    Re: Question: where is utmp entry deleted at logout?
From:       Stef Bon <stef () bononline ! tk>
Date:       2005-10-14 8:51:44
Message-ID: 200510141051.44159.stef () bononline ! tk
[Download RAW message or body]

On Wednesday 12 October 2005 07:13, Yuri Kozlov wrote:

> from login.1
>
> The  login  program is NOT responsible for removing users from the utmp
>        file.  It is the responsibility of getty(8) and  init(8)  to  clean 
> up apparent  ownership  of  a terminal session.  If you use login from the
> shell prompt without exec, the user you use will continue to appear  to be
> logged in even after you log out of the "subsession".

Thanks, I've tried this and indeed, it looks as the user of the subsession is 
still logged in.

I've been testing this more. When I login with 'login', and look with the 
command "who -u" to the users logged in, I see:

who -u

--snip

root		su[6041]	Oct 14 10:25	?	6041
sbon		pts/1		Oct 14 10:25	00:02	6124


And when I look at the processes with "ps aux" I get:

--snip

root	6124	0.0	0.7	6544	2020 ?		S	10:25	0:00 login --sbon
sbon	6183	0.0	0.7	5396	1972 pts/1	Ss	10:25	0:00 -bash

Now when I look at this, this can't be right! In the utmp file the pid of the 
login process is stored, and not of what the user is actually doing: bash 
(6183)!! This looks like a bug to me. When I look to the source of login, I 
can explain this very easy: in entry in the utmpdatabase is written before 
forking (creating a childprocess for the user to enter his shell) and so the 
pid is taken of the parent (login) process, and not of the child (shell).

Am I right on this??

Stef Bon

PS

When I look to another way to login, kdm, this is handled ok.

I discovered this difference in behaviour working on my hint to execute 
scripts at the begin and the end of a usersession, using PAM. Look at:

http://www.linuxfromscratch.org/hints/read.html


>
> --
> Regards,
> Yuri Kozlov
> _______________________________________________
> shadow mailing list
> shadow@pld.org.pl
> http://mail.pld.org.pl/mailman/listinfo/shadow
_______________________________________________
shadow mailing list
shadow@pld.org.pl
http://mail.pld.org.pl/mailman/listinfo/shadow
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic