On 21 June 2013 16:29, Michał Górny <mgo...@gentoo.org> wrote: > Dnia 2013-06-21, o godz. 10:16:10 > William Hubbs <willi...@gentoo.org> napisał(a): > >> On Fri, Jun 21, 2013 at 12:23:28PM +0200, Michał Górny wrote: >> > > If eselect-init installs the wrapper as /sbin/einit, we don't have to >> > > 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=/sbin/einit on the 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ł Górny
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