From owner-freebsd-stable@FreeBSD.ORG Wed Oct 29 21:00:20 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2BD11065675 for ; Wed, 29 Oct 2008 21:00:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0918FC16 for ; Wed, 29 Oct 2008 21:00:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KvI9K-0000WU-IL; Wed, 29 Oct 2008 23:00:18 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m9TL0F1u007681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Oct 2008 23:00:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id m9TL0F6o027001; Wed, 29 Oct 2008 23:00:15 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9TL0Fge027000; Wed, 29 Oct 2008 23:00:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 29 Oct 2008 23:00:15 +0200 From: Kostik Belousov To: =?koi8-r?B?7cnIwcnMIOvJ0ME=?= Message-ID: <20081029210015.GH18100@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lf0NQ8GVTdtriwpn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KvI9K-0000WU-IL 74c9e6afc2e8fe12d0f97b3522936343 X-Terabit: YES Cc: freebsd-stable@freebsd.org Subject: Re: Where is new session creation in init-getty-login X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2008 21:00:20 -0000 --lf0NQ8GVTdtriwpn Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 29, 2008 at 07:26:50PM +0300, =ED=C9=C8=C1=C9=CC =EB=C9=D0=C1 w= rote: >=20 > 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. --lf0NQ8GVTdtriwpn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkIzt4ACgkQC3+MBN1Mb4hv7wCfbsrdZ4y7wZpf0w1nUnYG/Rlj jUEAn3F9I1+MDMnqHAe9EAvcN4A7t/bR =nrkc -----END PGP SIGNATURE----- --lf0NQ8GVTdtriwpn--