Re: Where is new session creation in init-getty-login - FreeBSD

This is a discussion on Re: Where is new session creation in init-getty-login - FreeBSD ; 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
...

Re: Where is new session creation in init-getty-login

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.