From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id DCCF91381F3 for ; Fri, 21 Jun 2013 16:14:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8FBF9E0919; Fri, 21 Jun 2013 16:14:16 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 62062E0853 for ; Fri, 21 Jun 2013 16:14:15 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id ey16so865354wid.3 for ; Fri, 21 Jun 2013 09:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=3JN8zAmYbrjSu6O21yp4JkZikJ/ItlRQeMQWy3zVdpU=; b=sWZQsRyWGEZbb0Nbs6vEH2Blrm9pdEASIVgZ0fBaiY76gwsUxJUPbgLhD8cyc8ZRQm DjMlOhAcIxcGq7ZbGVhQO3W/i2M6f6Ol2oO+rte7EhMaJOC/4GcYU3hWrjSCiwBqhM0W 0xv8gaz4y4U5x/58XH7b/GChQbqGMyBp7ix+o0SyAoyoO9Anap0N3FvinYLpzhCKwk2a Gp08omewrH4LBlk2S3WHk6Ajai1TJhDJrL0Mn0s8vlE1E71JYQ0i29K5sYpcvzSMB3qT zQ3FlCID99bnr1RUEn6Q7GunyZP7y1Q3WxwQm1q6SIBrvtDfDgDyUJIwncJm5cz7NkEe qsRg== X-Received: by 10.180.198.175 with SMTP id jd15mr3263550wic.28.1371831253902; Fri, 21 Jun 2013 09:14:13 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Sender: markos.chandras@gmail.com Received: by 10.194.136.115 with HTTP; Fri, 21 Jun 2013 09:13:33 -0700 (PDT) In-Reply-To: <20130621172941.1dd87fd1@gentoo.org> References: <51A08A68.3020900@gentoo.org> <20130620205609.GB23719@linux1> <20130621043959.7eae0921@gentoo.org> <20130621041600.GA24770@linux1> <20130621122328.662eddc0@gentoo.org> <20130621151610.GA26281@linux1> <20130621172941.1dd87fd1@gentoo.org> From: Markos Chandras Date: Fri, 21 Jun 2013 17:13:33 +0100 X-Google-Sender-Auth: 7uxz_a4GuHswKqBLTUq636mseTg Message-ID: Subject: Re: [gentoo-dev] eselect init To: gentoo-dev Cc: williamh@gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 3b1eba9f-45d4-4a3b-9505-de8f17e4d257 X-Archives-Hash: b8995237526bf195dbf4b4724ceeb0e8 On 21 June 2013 16:29, Micha=C5=82 G=C3=B3rny wrote: > Dnia 2013-06-21, o godz. 10:16:10 > William Hubbs napisa=C5=82(a): > >> On Fri, Jun 21, 2013 at 12:23:28PM +0200, Micha=C5=82 G=C3=B3rny wrote: >> > > If eselect-init installs the wrapper as /sbin/einit, we don't have t= o >> > > touch /sbin/init at all, then, the only thing someone would have to = do >> > > is to add an entry to their boot loader with init=3D/sbin/einit on t= he kcl >> > > to use it. >> > >> > But *if* the wrapper fails to run somehow, e.g. becomes broken, >> > the kernel will fallback to the standard location. >> >> Yes, but if the wrapper replaces /sbin/init, like it does now, and the >> wrapper gets broken, I think you are left with an unbootable system. > > Then kernel falls back to safe /bin/sh which is a minimal safe fallback. > > -- > Best regards, > Micha=C5=82 G=C3=B3rny Correct. Even if your init end up being broken you end up with a shell so you can fix things yourself. (from init/main.c) /* * We try each of these until one succeeds. * * The Bourne shell can be used instead of init if we are * trying to recover a really broken machine. */ if (execute_command) { if (!run_init_process(execute_command)) return 0; pr_err("Failed to execute %s. Attempting defaults...\n", execute_command); } if (!run_init_process("/sbin/init") || !run_init_process("/etc/init") || !run_init_process("/bin/init") || !run_init_process("/bin/sh")) return 0; But this is not pretty. Not everyone knows how to recover from a broken init. The eselect module aims to offer an elegant way to switch init systems but if that fails then you need some advanced knowledge to fix your system. So my opinion is that before such thing is introduce to the wild, we need to be confident that it will never fail but even if it does, you need to provide a documented way on how to recover. Maybe a bold warning with post-mortem instructions when you first invoke the eselect module is one way to do it. -- Regards, Markos Chandras - Gentoo Linux Developer http://dev.gentoo.org/~hwoarang