Gentoo Archives: gentoo-user

From: Mike Edenfield <kutulu@××××××.org>
To: gentoo-user@l.g.o
Subject: RE: [gentoo-user] Re: systemd? [ Was: The End Is Near ... ]
Date: Thu, 22 Mar 2012 22:08:59
Message-Id: 019e01cd0878$23582790$6a0876b0$@kutulu.org
In Reply to: Re: [gentoo-user] Re: systemd? [ Was: The End Is Near ... ] by Walter Dnes
1 > From: Walter Dnes [mailto:waltdnes@××××××××.org]
2 > Sent: Thursday, March 22, 2012 5:14 PM
3
4 > On Wed, Mar 21, 2012 at 09:35:55PM -0400, Michael Mol wrote
5 >
6 > > What we're talking about with systemd vs openrc, and things like ssh'd
7 > > first-time initialization is all within the realm of responsibility of
8 > > the packager. It's a shift in the way the distribution itself works.
9 > > We're not talking about a scenario where you shunt things upstream, so
10 > > the whole "your position would have rejected Linux" angle is a red
11 > > herring.
12 >
13 > This is a frustrating game of whack-a-mole. Person A comes up with a
14 > position, I rebut it, and then person B comes up with a different
15 position, and
16 > I have to rebut it.. There have been people in this thread who have said
17 that
18 > the program best knows what it needs, and should handle its own
19 > initialization. That was what I was replying to.
20 > I'll reply to your position now.
21
22 You know the old adage, if you ask 5 geeks a question you get 6 different
23 answers.
24
25 This whole discussion is somewhat surreal to me, when taken in conjunction
26 with the other heated debate we just finished having:
27
28 * udev is evil and horrible because it's trying to do too much and is too
29 complex.
30 * system is evil and horrible because it isn't doing enough and is too
31 simple.
32
33 And I'm pretty I've seen at least one person making both arguments
34 simultaneously.
35
36 > > Why does that spawned process have to be sshd? Why can't it be some
37 > > shell script which does the one-time checks, and then launches sshd
38 > > itself?
39 >
40 > So instead of the initscript doing the checking+setup and launching the
41 > service, it launches a a second script... which does the
42 > checking+setup and launches the service <FACEPALM>. See my post with
43 > the joke of digging a second hole to dump the dirt from the first hole
44 into.
45 > Instead of one script, we now have two scripts. This is *NOT*
46 simplification.
47
48 It works fine for mysql, or postfix, or apache, or any of the dozens of
49 other programs that have helper scripts whose sole purposes is to act as an
50 entry point to starting up the actual service. It's a common and
51 well-accepted way of performing required initialization on startup. I don't
52 see why sshd has to be special here.
53
54 > > Why does that shell script need to be distributed as part of the init
55 > > system's package, and not part of the package associated with the
56 > > service?
57 >
58 > I don't understand what you're arguing here. *THE INITSCRIPT IS OWNED
59 BY
60 > THE SERVICE PACKAGE*, not by the init package. E.g. net-misc/openssh, not
61 > sys-apps/openrc.
62
63 You are absolutely correct; the discussion of who "owns" the init script is
64 completely tangential to the system vs openrc argument; in both cases, the
65 required startup files will be provided by the package maintainer and
66 installed by the ebuild, not by the rc system. I think the confusion may
67 have started way back when Canek tried to compare the "simplicity" of
68 sshd.service to the "complexity" of /etc/init.d/sshd. That's the unfair,
69 apples-to-oranges comparison that triggered this entire debate.
70
71 The part that's been lost here is that system doesn't run init scripts(*);
72 it launches configured services. These are *not* shell scripts; they are
73 ini-file-like things that define parameters, much like xinetd's
74 configuration files. Of course, I don't see why this is a problem: configure
75 system to launch sshd's init script, which keeps doing the same thing it
76 always has been doing. This is why the comparison between systemd's service
77 config and openrc's script is unfair. You /cannot/ get rid of the complexity
78 of /etc/init.d/sshd, you can only make it so that openrc and systemd can
79 *both* take advantage of that complexity when starting sshd. That may, of
80 course, require the package maintainer to provide 3 items instead of one: an
81 openrc init script, a systemd service description, and an rc-agnostic helper
82 script, in order to be fully systemd-compatible. In the meantime, the
83 systemd package maintainer will likely be forced to provide some kind of
84 compatibility shims to run existing openrc scripts that have not yet been
85 refactored, but that's the cost of choice.
86
87 It may already do this, I don't know. I have not yet installed systemd
88 anywhere but I am curious enough to try it on my laptop. So I will be that
89 much more informed in the near future :)
90
91 (*) As I understand it, systemd *can* run SysV-style init scripts, but
92 Gentoo's startup scripts are too dependent on openrc-supplied logic to be
93 reusable in any meaningful sense.
94 --Mike