Gentoo Archives: gentoo-dev

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] eselect init
Date: Sat, 25 May 2013 19:10:19
Message-Id: 5d832c4680bfbd3ae7da6dfe5608be2d.squirrel@www.antarean.org
In Reply to: Re: [gentoo-dev] eselect init by Tom Wijsman
1 On Sat, May 25, 2013 15:38, Tom Wijsman wrote:
2 > On Sat, 25 May 2013 11:54:48 +0200
3 > Luca Barbato <lu_zero@g.o> wrote:
4 >
5 > <SNIPPED>
6 > there's one option we forget about
7 > here though, EFI users can build a second smaller minimally adjusted
8 > defconfig kernel that ends up loading the default init system if they
9 > wish to repair their system without chrooting.
10
11 Good suggestion, especially as I am trying out EFI-boot on one of my
12 machines with intention to keep it on EFI if it works.
13
14 > So, please see the /sbin/einit suggestion in Bug 465236 at Comment 34
15 > at https://bugs.gentoo.org/show_bug.cgi?id=465236#c34 which documents a
16 > sane alternative that allows users to load the default init system of
17 > Gentoo through their boot loader if they wish to do. This suggestion
18 > doesn't kill the eselect approach, but goes side-by-side with it; it
19 > effectively just names it /sbin/einit instead of /sbin/init to keep the
20 > default /sbin/init around. Another advantage is that users that don't
21 > want extra complexity as they don't want to compare or switch init
22 > systems will not get extra complexity added to their system.
23
24 I was thinking of a "default" option in the "eselect init" part that would
25 remove "init=/sbin/einit" from the kernel boot parameters.
26 Not sure how that would be best achieved as a lot (most?) users will have
27 more then one boot-option in their grub(2)/lilo config.
28
29 >> - /sbin/init (or whatever linux currently calls by default with top
30 >> priority)
31 >
32 > Correct as far as I recall from patching that part of boot in the past.
33
34 I don't have "init=" set on my machines and it seems to start /sbin/init.
35 So that should be correct.
36
37 >> should be either a symlink to the actual implementation or a
38 >> wrapper such as our gcc one.
39 >
40 > Wrapper sounds more safe to me since you allow more logic to be
41 > incorporated and aren't to restricted in what you can do with it early
42 > on, on the other hand a symlink would be a much more clean approach if
43 > you don't need more logic than just the symlink; although I'm not sure
44 > if the kernel loves a symlink for /sbin/init, haven't looked at that...
45
46 +1 for wrapper, from my understanding, symlinks for init-systems can't be
47 altered on a running system without risking strange behaviour.
48
49 >> eselect init
50 >> must keep track of the current active init and make sure the current
51 >> init configuration is used till the system reboots
52 >
53 > When we kick off the right init system at boot, we probably don't need
54 > to keep track of it separately; or at least not call eselect for that.
55 >
56 > Sounds like we would have two files like 'current_init' and 'boot_init'
57 > and `eselect init ...` would update 'boot_init'. Then, the first `init`
58 > invocation on boot would update 'current_init' with the value of
59 > boot_init; latter `init` invocations can then read out 'current_init',
60 > which is not to be touched by `eselect init ...`.
61
62 With a case-statement in the wrapper script to handle the different
63 init-systems?
64 How will the stop/start part of services/init-scripts/... be done?
65 I am assuming that should be for the user to keep in mind, but will it be
66 possible to add something that will make init.d-scripts not work when
67 systemd is running and unit-files not work when systemd is not running?
68
69 From what I understand, the tools for the different init-systems will end
70 up being installed simultaneously.
71
72 >> hooks on reboot are still needed for more complex ones.
73 >
74 > Which complex cases would these hooks be needed on?
75
76 I think one of these would be the stopping/starting of services (see above)
77
78 >> - we could try to not have the changes to the current init systems
79 >> ebuild or reduce them to the bare minimum (e.g. not
80 >> overwrite /sbin/init)
81 >
82 > The /sbin/einit approach that I linked near the start would help here.
83 >
84 >> # FOCUS
85 >>
86 >> My interest is mostly if not all on bb-init-openrc and slightly on
87 >> runit-openrc.
88 >>
89 >> There are enough people involved in systemd and since I still consider
90 >> it a dangerously frail implementation of a bad idea is better if I do
91 >> not touch it at all.
92 >>
93 >> My system with stock openrc gets from linux start to graphical login
94 >> in less than 6s and I'm not using Gnome so I do not have any reason
95 >> to use it beside comparing.
96 >
97 > Can we please keep information that may provoke a comparison off the ML?
98 >
99 > I'll give a neutral objective response why the init system doesn't
100 > matter for this, as I'm tired of seeing people sneak in data points
101 > like this. In your case it's intended to be good, but it can catch
102 > other people off guard that don't care to stay on topic.
103 >
104 > [[ Please avoid responding to this part of my mail, don't go OT. ]]
105
106 <SNIPPED part about boot times>
107 I agree with the general statement here.
108
109 [[ Below is my ONLY remark on that, please feel free to mentally paste it
110 as a response any email trying to explain why it's important to reduce the
111 boottime ]]
112
113 Boot times can be optimized for most init-systems.
114 On most of my machines, I really don't care if the boot time is 2 seconds
115 or 2 minutes. They get started once and then they stay on till they are
116 not needed anymore. As long as boot-time isn't too much longer then it
117 takes me to get my coffee from the kitchen, it does not matter :)
118
119 --
120 Joost Roeleveld

Replies

Subject Author
Re: [gentoo-dev] eselect init Tom Wijsman <TomWij@g.o>