Gentoo Archives: gentoo-dev

From: "Steven J. Long" <slong@××××××××××××××××××.uk>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Re: eselect init
Date: Tue, 25 Jun 2013 04:52:58
Message-Id: 20130625045320.GA18277@rathaus.eclipse.co.uk
In Reply to: Re: [gentoo-dev] Re: eselect init by William Hubbs
1 On Thu, Jun 20, 2013 at 03:48:29PM -0500, William Hubbs wrote:
2 > On Thu, Jun 20, 2013 at 06:10:27PM +0100, Steven J. Long wrote:
3 > > Fabio Erculiani wrote:
4 > > > - only init is currently handled by eselect-init, which is now using a
5 > > > very small wrapper POSIX shell script to redirect the calls to the
6 > > > currently running init
7 > >
8 > > How does say, switching inittab format, work under this setup?
9 >
10 > I think this is a separate issue -- if busybox init's inittab is a
11 > different format than sysvinbb's inittab, it should also use a different
12 > file name, e.g. bb-inittab or something similar.
13 >
14 > bb could fall back to inittab, but I think it should look for something
15 > liike bb-inittab first. That way eselect init wouldn't have to worry
16 > about it at all.
17
18 You're missing the point, because of your usual monomania for specific rather
19 than general use-cases. 'Say' meant it was an example.
20
21 I asked the question, because AFAICT from reading the code, the proposed approach
22 keeps an indication of the running init, from startup, and then traps every call
23 to that init, to check whether eselect has in the interim changed the symlink to
24 point elsewhere.
25
26 If einit instead simply checked whether there was a 'switchto' file at startup,
27 it would be able to handle the more general problem, as well as running more
28 efficiently and robustly, with no need to mess around with symlinks.
29
30 The complexity would then be in eselect confirming, eg that the 'to' init is
31 installed and configured, before setting the file for the next reboot. And
32 optionally in the switcher when starting the new init at boot, if it should
33 need anything tricky carried out, which might interact badly with a currently
34 running init.
35
36 That's a re-iteration of Duncan's idea, ofc.
37
38 I'm also curious as to how an initramfs fits into the schema, given that there
39 may be things that need to be done before pid 1 is started (or if not, I have nfc
40 what all the discussion about replacing the kernel mechanism was in aid of.)
41
42 --
43 #friendly-coders -- We're friendly, but we're not /that/ friendly ;-)