Gentoo Archives: gentoo-dev

From: Tom Wijsman <TomWij@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] eselect init
Date: Sun, 26 May 2013 09:47:53
Message-Id: 20130526114538.315f106a@TOMWIJ-GENTOO
In Reply to: Re: [gentoo-dev] eselect init by "Michał Górny"
1 On Sun, 26 May 2013 11:20:25 +0200
2 Michał Górny <mgorny@g.o> wrote:
3
4 > It is *easy*.
5 >
6 > ln -s /sbin/newinit /sbin/init.new
7 > mv /sbin/init.new /sbin/init
8 >
9 > Easy and atomic. The inconsistency potential is similar to one given
10 > by init upgrades. Yet we don't do anything magical to defer init
11 > upgrade until reboot, and that's why the upgrades go smoothly.
12
13 Easy isn't always good. It's not atomic since you can't reboot and
14 because of that I wouldn't call it smooth either.
15
16 > > I think that safest way not using wrapper is to stop all services
17 > > and keep only mounted /, than change things (symlinks,configuration
18 > > update) and reboot.
19 >
20 > This can be done two ways.
21 >
22 > One is hacking into init (RC) reboot procedure. It's fragile, it needs
23 > to be fit into the right moment and I'm not sure if all inits will
24 > handle this without actually needing to patch the code. And in the
25 > end, the init gets replaced before init stops working anyway.
26
27 You're making things way more complex than a wrapper would do. I'm not
28 a fan of using the words "hacking", "fragile" and "not sure" for
29 selling an approach; so, why were you suggesting the symlink approach?
30
31 > The other is going beside init and directly into the reboot. This
32 > either requires kernel hacking (please don't!)
33
34 Yes, please don't, it's against our general objectives.
35
36 http://www.gentoo.org/proj/en/kernel/maintenance.xml#doc_chap3
37
38 Furthermore, even if you would consider this then you can't be
39 guaranteed that everyone uses genpatches; and I don't think we would
40 want this in the eclass either, its users will very likely object.
41
42 > or hacking the reboot procedure in init code. And of course
43 > remounting R/W, then writing, remounting back...
44
45 I don't think patching them is a reliable approach; it steps away from
46 being loosely coupled and therefore makes it harder to understand, you
47 are changing multiple things at once and introduce a maintenance burden.
48
49 With a wrapper, you don't have a problem with any of those...
50
51 Loose coupling, high cohesion.
52
53 --
54 With kind regards,
55
56 Tom Wijsman (TomWij)
57 Gentoo Developer
58
59 E-mail address : TomWij@g.o
60 GPG Public Key : 6D34E57D
61 GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] eselect init "Michał Górny" <mgorny@g.o>