public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: lu_zero@gentoo.org
Subject: Re: [gentoo-dev] eselect init
Date: Sun, 26 May 2013 12:57:42 +0200	[thread overview]
Message-ID: <20130526125742.4584d094@gentoo.org> (raw)
In-Reply-To: <51A1DC0C.2070706@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 5524 bytes --]

On Sun, 26 May 2013 11:55:24 +0200
Luca Barbato <lu_zero@gentoo.org> wrote:

> On 5/26/13 8:43 AM, Michał Górny wrote:
> > On Sat, 25 May 2013 11:54:48 +0200
> > Luca Barbato <lu_zero@gentoo.org> wrote:
> >
> >> - /sbin/init (or whatever linux currently calls by default with top
> >> priority) should be either a symlink to the actual implementation or a
> >> wrapper such as our gcc one. I like better the latter since it is
> >> overall safer. The former might or might work since linux has some
> >> fallback capabilities but hadn't been tested.
> >
> > Increased complexity is never safer. And a wrapper means the additional
> > complexity gets there every boot. And considering how the discussion
> > goes, the wrapper will grow openrc-size in a few months...
> 
> Openrc is small, but the wrapper really needs to know which is which and 
> worst case switch inittab.

Switch inittab? Now you added really dangerous behavior to the wrapper
code. I can hardly even express this in words.

You are telling me that a wrapper, a thing that gets executed *every*
boot needs to do some random magic to know which init system was in use
and which one is supposed to be in use, and then conditionally move
around configuration files necessary for it to run. This is just
*INSANE*.

Did anyone notice already that moving stuff around actually requires
rootfs mounted R/W? Which means the wrapper needs to repeat a fair bit
of init/RC work.

And what will happen if moving the files fail? What if half of
configuration belongs to old init, and half to new? And it all happens
automagically on boot, on an incomplete system without any console
started, without Internet connection established and without any
serious mean of help.

> > Symlinks are simple. They're filesystem feature, they're handled
> > by kernel. The worst thing that could happen is symlink target
> > disappearing -- but then it's:
> >
> > a) our responsibility to make sure to call eselect-init (if applies)
> > when uninstalling an init system,
> >
> > b) something that would fail anyway if user did that by hand.
> >
> > Linux fallback mechanism is *good enough*. You may think that fallback
> > to sysvinit is good but it's not. *If* I have my system set up to boot
> > X, at some point the config for Y will get seriously outdated.
> 
> Have you tested it? Do you know what is the reaction of do_exec on a 
> dangling symlink?

And did you? You keep repeating this and jumping straight to developing
work-arounds without even waiting for an answer. And I think William
has already spoken that the code supports it.

In any case, I've just tested it. Replaced /sbin/init with a dangling
symlink, rebooted with init=/sbin/init and the kernel ran /bin/sh
as a fallback.

> > I use systemd for a few months now, and last time I checked openrc
> > boots somehow. But considering the general complexity of it, I wouldn't
> > be much surprised if it failed in funny ways (like not being able to
> > handle automounts properly), caused cruft on the filesystem or even
> > caused *damage*.
> 
> openrc is *simpler* much *simpler* than systemd, stop with that.

OpenRC relies on a few layers of various tools plus a lot of init
scripts written by different people. Those init scripts include tasks
such as parsing configuration files (well, more of grepping them)
and manipulating runtime files. The complexity of OpenRC is the sum
of all that.

To make this point cleaner to you: what if the fallback ran systemd
instead? As in, init gets broken somehow and kernel falls back to
starting systemd on your unprepared OpenRC system. Is this a behavior
you'd like?

What I'm telling is: if user uses A as init system (and wanted to switch
to B), last thing he'd expect is C being started. Configuration for
OpenRC may be long unmaintained, may start services which are not
supposed to be started anymore and so on.

> > And since you've been failing long at keeping init.d scripts simple
> > and reasonable, the damage potential is not something purely
> > theoretical.
> 
> wc -l is a good answer to your concern. Some scripts have to be 
> simplified, that's a given (e.g. Fabio pointed the lvm one can be 
> improved a lot) but it isn't the case for most of them.

We're not talking about percentages here. A *single* fragile script is
enough to cause trouble. Ten good ones won't revert it.

> > Pointless and overcomplex. If an init system actually fails to work
> > when /sbin/init doesn't point to it, it is seriously broken by design.
> > And because of that breakage, we keep stuff like 'telinit' or 'reboot'
> > intact, and because of it systemd has 'pass-through' mode when linked
> > to /sbin/init.
> 
> Check your facts, systemd either understands a flavour of inittab or the 
> other or none at all.

What are you talking about now? I was just saying that *if* you
link /sbin/init to systemd, and you're running sysvinit, 'init foo'
will be passed through to telinit.

But now I see that I was wrong and it actually happened when
'systemctl' was symlinked to 'init'. Nevermind then.

In any case, keeping all the tools like 'telinit' should be *enough* to
keep the current init running and rebooting.

> > Which means the kernel fallback will be dangerously active
> > as I explained before. Just don't do it.
> 
> It is not dangerous beside for those that have an inittab with rm -fR /

n/c

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

  parent reply	other threads:[~2013-05-26 10:57 UTC|newest]

Thread overview: 139+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25  9:54 [gentoo-dev] eselect init Luca Barbato
2013-05-25 10:25 ` Peter Stuge
2013-05-25 11:57   ` Tom Wijsman
2013-05-26  1:52     ` Walter Dnes
2013-05-26  8:50       ` Tom Wijsman
2013-05-26  2:02     ` Peter Stuge
2013-05-26  8:56       ` Tom Wijsman
2013-05-25 19:08   ` Matthew Thode
2013-05-26 14:13     ` Ian Stakenvicius
2013-05-26 23:54       ` Luca Barbato
2013-05-25 11:13 ` Pacho Ramos
2013-05-25 12:03   ` Tom Wijsman
2013-05-25 12:25     ` Pacho Ramos
2013-05-25 15:42   ` Luca Barbato
2013-05-25 11:29 ` Sergei Trofimovich
2013-05-25 12:12   ` Tom Wijsman
2013-05-25 13:15   ` Luca Barbato
2013-05-25 17:35     ` Sergei Trofimovich
2013-05-25 19:49   ` Chí-Thanh Christopher Nguyễn
2013-05-25 12:13 ` hasufell
2013-05-25 15:51   ` Luca Barbato
2013-05-25 13:38 ` Tom Wijsman
2013-05-25 19:09   ` J. Roeleveld
2013-05-25 19:55     ` Tom Wijsman
2013-05-25 20:07       ` Alex Xu
2013-05-25 20:59         ` Tom Wijsman
2013-05-26 12:59       ` J. Roeleveld
2013-05-26 13:58         ` Tom Wijsman
2013-05-26 14:54         ` Ian Stakenvicius
2013-05-26 13:15       ` Michał Górny
2013-05-26 14:07         ` Tom Wijsman
2013-05-26 14:44           ` Rich Freeman
2013-05-26  6:43 ` Michał Górny
2013-05-26  8:58   ` Robert David
2013-05-26  9:20     ` Michał Górny
2013-05-26  9:32       ` Robert David
2013-05-26  9:45       ` Tom Wijsman
2013-05-26 10:09         ` Michał Górny
2013-05-26 11:45           ` Tom Wijsman
2013-05-26 12:01             ` Michał Górny
2013-05-26  9:21     ` Tom Wijsman
2013-05-26 10:01       ` Robert David
2013-05-26 10:11         ` Rich Freeman
2013-05-26 10:18           ` Chí-Thanh Christopher Nguyễn
2013-05-26 11:28           ` hasufell
2013-05-26 12:10         ` Tom Wijsman
2013-05-26  9:55   ` Luca Barbato
2013-05-26 10:39     ` Tom Wijsman
2013-05-26 10:57     ` Michał Górny [this message]
2013-05-26 11:40       ` Luca Barbato
2013-05-26 12:08         ` Michał Górny
2013-05-26 12:24           ` Luca Barbato
2013-05-26 14:58         ` Ian Stakenvicius
2013-05-27 10:36           ` [gentoo-dev] Switchup-mode and boottime selector? Was: " Duncan
2013-05-27 20:26             ` Alex Xu
2013-05-27 22:40             ` Walter Dnes
2013-05-28  9:56               ` [gentoo-dev] " Duncan
2013-05-28 11:56                 ` Tom Wijsman
2013-05-29  0:36                   ` Duncan
2013-05-29  8:52                     ` Tom Wijsman
2013-05-29 18:15                       ` Walter Dnes
2013-05-29 19:56                         ` Tom Wijsman
2013-05-29 20:55                           ` William Hubbs
2013-05-30  0:06                             ` Tom Wijsman
2013-05-30  0:22                               ` William Hubbs
2013-05-30  1:36                                 ` Duncan
2013-05-30  6:35                                 ` Tom Wijsman
2013-05-30 20:41                                   ` William Hubbs
2013-05-30  6:46                                 ` Ciaran McCreesh
2013-05-30 13:54                                   ` Ian Stakenvicius
2013-05-31  6:21                                     ` Ciaran McCreesh
2013-05-30  6:30                             ` Luca Barbato
2013-06-22 19:35                             ` Markos Chandras
2013-05-30  2:52                           ` Walter Dnes
2013-05-30  6:19                             ` Tom Wijsman
2013-05-30  6:36                               ` Dale
2013-05-30  6:31                             ` Ciaran McCreesh
2013-05-28  3:55           ` [gentoo-dev] " Luca Barbato
2013-05-28  4:19             ` Michał Górny
2013-05-28  4:43               ` Luca Barbato
2013-05-28 12:15                 ` Ian Stakenvicius
2013-05-28 12:15                 ` Ian Stakenvicius
2013-05-26 11:58       ` Tom Wijsman
2013-05-26 14:52         ` Luca Barbato
2013-05-26 15:39           ` Tom Wijsman
2013-05-26 16:41     ` William Hubbs
2013-05-26 16:48       ` William Hubbs
2013-05-26 16:55         ` Michał Górny
2013-05-26 22:58           ` William Hubbs
2013-05-26 23:47             ` Luca Barbato
2013-05-27 23:45               ` [gentoo-dev] Separate boot/root already [WAS: eselect init] Walter Dnes
2013-05-28 15:07                 ` Luca Barbato
2013-06-01  9:23 ` [gentoo-dev] Re: eselect init Steven J. Long
2013-06-01 11:43   ` Steven J. Long
2013-06-02  9:15   ` Luca Barbato
2013-06-02 18:20     ` [gentoo-dev] " Steven J. Long
2013-06-02 18:48       ` Fabio Erculiani
2013-06-08 13:37         ` [gentoo-dev] " Steven J. Long
2013-06-02 22:35       ` [gentoo-dev] " Luca Barbato
2013-06-03  0:37         ` Walter Dnes
2013-06-03  0:57           ` Rich Freeman
2013-06-03  7:03           ` Tom Wijsman
2013-06-03  9:42           ` Luca Barbato
2013-06-03  6:19         ` [gentoo-dev] " Duncan
2013-06-03  6:26         ` [gentoo-dev] " Pacho Ramos
2013-06-04 18:55         ` William Hubbs
2013-06-04 19:09           ` Rich Freeman
2013-06-08 13:28         ` [gentoo-dev] " Steven J. Long
2013-06-20 10:16 ` [gentoo-dev] " Fabio Erculiani
2013-06-20 17:10   ` [gentoo-dev] " Steven J. Long
2013-06-20 20:48     ` William Hubbs
2013-06-25  4:53       ` [gentoo-dev] " Steven J. Long
2013-06-20 20:56   ` [gentoo-dev] " William Hubbs
2013-06-21  2:39     ` Michał Górny
2013-06-21  4:16       ` William Hubbs
2013-06-21 10:23         ` Michał Górny
2013-06-21 15:16           ` William Hubbs
2013-06-21 15:23             ` Fabio Erculiani
2013-06-21 16:42               ` William Hubbs
2013-06-22 11:23                 ` Jason A. Donenfeld
2013-06-22 11:57                   ` hasufell
2013-06-21 19:34               ` Luca Barbato
2013-06-22  1:27                 ` Ulrich Mueller
2013-06-22  1:48                   ` Michael Weber
2013-06-21 15:29             ` Michał Górny
2013-06-21 16:13               ` Markos Chandras
2013-06-21 16:50                 ` William Hubbs
2013-06-21 19:36                   ` Luca Barbato
2013-06-21 10:30       ` Michael Weber
2013-06-21 11:19         ` Fabio Erculiani
2013-06-21 11:26           ` Pacho Ramos
2013-06-21 11:50             ` Luca Barbato
2013-06-21 14:36               ` William Hubbs
2013-06-21 15:48                 ` Pacho Ramos
2013-06-22  6:59                   ` [gentoo-dev] " Duncan
2013-06-22 10:07                     ` Pacho Ramos
2013-06-22 11:13                       ` Michael Weber
2013-06-22 11:26                         ` Rich Freeman
2013-06-22 17:05                       ` Luca Barbato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130526125742.4584d094@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=lu_zero@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox