On Wed, Oct 29, 2008 at 07:26:50PM +0300, νΙΘΑΙΜ λΙΠΑ wrote:
>
> I can`t find the place in the source where new session creates when
> I login via local terminal. There is no call to setsid() after init
> forks in start_getty(session_t *sp) and no calls to that function in
> getty and login. But when I login to the local terminal, exit and
> login again I will have different session ID`s (pid numbers of session
> leader process). So I wan`t to know where login process become a
> session leader?


Watch for the login_tty(3) calls both in init and in getty. This function
from libutil sets up the session and controlling terminal. It is called
from init for single-user shell and rc script. getty calls it for
line logons.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkkIzt4ACgkQC3+MBN1Mb4hv7wCfbsrdZ4y7wZ pf0w1nUnYG/Rlj
jUEAn3F9I1+MDMnqHAe9EAvcN4A7t/bR
=nrkc
-----END PGP SIGNATURE-----