From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 27 23:22:39 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF0F716A403 for ; Wed, 27 Dec 2006 23:22:39 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id ABCE013C48E for ; Wed, 27 Dec 2006 23:22:39 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id E660A5F50; Thu, 28 Dec 2006 01:50:52 +0300 (MSK) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id C3D2B5F28; Thu, 28 Dec 2006 01:50:52 +0300 (MSK) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id kBRMoQfn076661; Thu, 28 Dec 2006 01:50:26 +0300 (MSK) (envelope-from ru) Date: Thu, 28 Dec 2006 01:50:26 +0300 From: Ruslan Ermilov To: Erik Udo Message-ID: <20061227225026.GA76597@rambler-co.ru> References: <4592C91C.2040801@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <4592C91C.2040801@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: freebsd-hackers@FreeBSD.org Subject: Re: Init.c, making it chroot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2006 23:22:40 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 27, 2006 at 09:27:24PM +0200, Erik Udo wrote: > How can i make init chroot after executing /etc/rc, and executing=20 > /etc/rc again in the chrooted enviroment? >=20 Go look at the NetBSD init(8) that can do this, and bring us back a patch for this. Quote from the NetBSD init(8) manpage: : 2. Multi-user boot (default operation). Executes /etc/rc (see rc(8)). : If this was the first state entered (as opposed to entering here : after state 1), then /etc/rc will be invoked with its first argument : being `autoboot'. If /etc/rc exits with a non-zero (error) exit : code, commence single user operation by giving the super-user a : shell on the console by going to state 1 (single user). Otherwise, : proceed to state 3. :=20 : If value of the ``init.root'' sysctl node is not equal to / at this : point, the /etc/rc process will be run inside a chroot(2) indicated : by sysctl with the same error handling as above. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFkviyqRfpzJluFF4RApTUAJ9pvHSUHurie8kVlO3xfr7QU7syGACfY25x 3a7+nJn3om3XmmsvioxmQPQ= =j3r0 -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--