Gentoo Archives: gentoo-dev

From: "vivo75@×××××.com" <vivo75@×××××.com>
To: gentoo-dev@l.g.o
Cc: Duncan <1i5t5.duncan@×××.net>
Subject: Re: [gentoo-dev] Re: Questions about SystemD and OpenRC
Date: Sun, 12 Aug 2012 13:35:32
Message-Id: 5027B0CC.3070703@gmail.com
In Reply to: [gentoo-dev] Re: Questions about SystemD and OpenRC by Duncan <1i5t5.duncan@cox.net>
1 Il 12/08/2012 11:43, Duncan ha scritto:
2 > Peter Stuge posted on Sun, 12 Aug 2012 02:12:38 +0200 as excerpted:
3 >
4 >> vivo75@×××××.com wrote:
5 >>> First problem udev/SD has is that it can't see all the file system
6 >>> labels, for some reason it only see sda and sdb so it's able to partly
7 >>> proceed in the boot sequence, mount / (root) but can't mount anything
8 >>> else.
9 >> What software parses the filesystem labels when you boot with openrc?
10 >>
11 >> (I ask because I never use labels myself.)
12 > Short answer, mount and udev, and the kernel directly when fed that
13 > information for root= on the kernel commandline. Openrc has basically
14 > nothing to do with it. As such, I don't know what systemd's doing, but
15 > if it indeed is a systemd bug, it's obviously doing /something/ rather
16 > different... probably interacting in some unpredicted way with udev now
17 > that they're integrating it.
18
19 exactly my bet, since openrc with the _same_ (not recompiled) udev does work
20
21 >
22 > Slightly more detail, quoting the mount (8) manpage:
23 >
24 > It is possible to indicate a block special device using its volume LABEL
25 > or UUID (see the -L and -U options below).
26 >
27 > The recommended setup is to use LABEL=<label> or UUID=<uuid> tags rather
28 > than /dev/disk/by-{label,uuid} udev symlinks in the /etc/fstab file.
29 > The tags are more readable, robust and portable. The mount(8) command
30 > internally uses udev symlinks, so use the symlinks in /etc/fstab has no
31 > advantage over LABEL=/UUID=. For more details see libblkid(3).
32 >
33 > Note that mount(8) uses UUIDs as strings. The UUIDs from command line or
34 > fstab(5) are not converted to internal binary representation. The string
35 > representation of the UUID should be based on lower case characters.
36 >
37 > <<<<<
38 >
39 > The implication of the "as strings, not converted to binary" in the last
40 > paragraph is that mount's simply doing a dumb string match against the
41 > appropriate /dev/disk/by-* symlink names and dereferencing the symlink
42 > after which it can proceed as usual if there's a match. It's udev (and
43 > thus now systemd, since they're combining) that's actually doing the
44 > work, exposing the /dev/disk/by-* symlinks with the correct references.
45 >
46 > As such, mount basically supports anything found in that location,
47 > including device hardware ID (combined with partition number where
48 > appropriate, listed in /dev/disk/by-id), the already mentioned filesystem
49 > LABEL (/dev/disk/by-label), PARTLABEL (GPT partitions have a partition
50 > label that's similar in function to the filesystem label, but set at gdisk
51 > time, not mkfs time, obviously this doesn't apply to legacy MBR
52 > partitioning), PARTUID, PATH (bus path, tho like traditional /dev/[hs]dX,
53 > this can be dynamic and the bus paths are longer and more obtuse for
54 > humans so there's generally little practical use for this one), and (as
55 > the manpage mentions, partition) UUID.
56 >
57 > It is however worth noting that PARTLABEL at least is new enough that at
58 > least as of a couple months ago when I looked at it for my md/raid setup,
59 > while udev passed thru the PARTLABEL for physical devices, it was NOT
60 > doing so for partitioned md/raid devices. (That mobo died and I don't
61 > have md/raid on the new system so I can't verify current kernel 3.6-rc1+
62 > and udev-187-r3 PARTLABEL-on-md/raid behavior.) So while people could
63 > setup their md/raid gpt partitions with partition-labels using gptfdisk
64 > (aka gdisk) or whatever, and I did so, only the ones on the physical
65 > disks showed up in udev, and at the time I was looking at it, I was
66 > running md/raid on virtually everything, so the feature was about useless
67 > for me.
68 >
69 > But that does mean that if mdev or whatever creates similar /dev/disk/by-
70 > *, that mount and friends should use it just as they would with udev,
71 > since all they're doing is a dumb string match and symlink deref.
72 >
73 > It'a also worth noting that the kernel's root= line can take a number of
74 > these (I'm not sure if it can take them all), including partlabel,
75 > according to information someone posted on the btrfs list (which I was
76 > following at the time, before I decided btrfs was too unstable still and
77 > that I'd wait until next year to try again). I was going to try it, but
78 > lost interest when I found I couldn't use it with fstab for my mdraid-
79 > based gpt partitions anyway. So all I can say is that it was reported to
80 > work on the btrfs list, and no one contradicted it, so...
81 >
82 >>> a) SD does not re-calculate it's deptree/services when exiting from
83 >>> rescue shell, it still try to start the "virtual" services as fstab
84 >>> would have never modified, a reboot is needed
85 >> systemctl --system daemon-reload ?
86 > I've not tried systemd yet nor have I yet researched it (I have the
87 > research vaguely scheduled for next year, sometime), but thanks to both
88 > of you for these details. Based on past experience, I expect I'm
89 > collecting the pieces even tho I don't have context to assemble them in,
90 > but as a result, when I /do/ research it and get that context, the pieces
91 > I already have thanks to discussions like this, will fall into place, and
92 > it'll be far easier to get upto speed than it would have been had I tried
93 > going into it "cold turkey".
94 >
95 > So while I could guess, I'll just shutup and listen for this part.
96
97 seem possible, when bug this bug will be fixed, honestly, I've not tried
98 that, also because the bigger delay was added by a timeout not a reboot
99 (that take 10 seconds)
100 https://bugzilla.redhat.com/show_bug.cgi?id=815727
101 unless we discover that virtual services are too complex to manage and
102 SD will always be bugged by similar stuff. Time will tell
103
104 >
105 >> I just work with the files on disk. The only time I use tools is if
106 >> systemd is running and needs to get told about updates. I don't think
107 >> there are any files that are not plain text, so I don't think any tools
108 >> are actually required.
109 > Useful to know. =:^)
110
111 All the virtual services don't have a corresponding file on disk, except
112 for the radix say ManageDisk@.device which get multiplexed automatically
113 (similar to some openrc services does with symlinks, think at net.eth0).
114 Having those materialized would be of great help in debugging
115
116 >
117 >> If there's a way to boot into a shell prompt, even if it is just bash
118 >> running as pid 1, then any system can be fixed. It requires knowing a
119 >> lot about how the system works though, so a lot about systemd if the
120 >> system uses systemd. Ie. knowing what files to change how in order to
121 >> accomplish desired results.
122 > FWIW, I actually have a set of grub2 menu entries with init=/bin/bash,
123 > for troubleshooting. =:^)
124 >
125 > But I think his point (valid or not) was that systemd's closing this
126 > avenue off as it's simply too monolithic to get information out of or to
127 > trial-start individual services even when not run as init, as is possible
128 > with openrc, for instance.
129 >
130 > With openrc, if you boot with init=/bin/bash, then try to start an openrc
131 > initscript, it'll protest that it's not init and that results may not be
132 > as intended due to lack of dependency tracking, etc, but it'll let you
133 > override and try anyway, you just have to manage the service deps
134 > manually or deal with the fallout if you screw it up.
135 >
136 > He appears to be saying that this doesn't work with systemd. If it's not
137 > init, it refuses to do /anything/ with its unit-file initscript
138 > substitutes. That /does/ sound like just the sort of complaint (of
139 > serveral) I've seen about systemd, but is it accurate?
140 >
141 > If it is, then yes, booting to init=/bin/bash (or from live-rescue media)
142 > and troubleshooting systemd problems from there *IS* going to be more
143 > difficult than doing the same thing from openrc, because openrc has the
144 > ability to override and one-off, while if this is correct, openrc doesn't.
145 correct, with an addition, even if things are fixable complexity _does_
146 matter, over a certain point of resources needed it really became "too
147 difficult" == "unfixable".
148 Near enough example to this discussion was the initrd used some years
149 ago from redhat (before dracut), it was simply plain unmodifiable in
150 human time, and this doing something _much_ simpler than SD.
151 >
152 >> I don't understand this at all. Even if we go with what you write, then
153 >> I expect that some providers will start to offer an ecosystem of
154 >> systemd-optimized experiences for those who want it - but I do not
155 >> believe for a second that those would somehow be exclusive to other
156 >> systems.
157 > In all these systemd threads, someone posted a link to gregkh's take on
158 > gentoo as posted on google+. In the comments that followed, Ted T'so and
159 > Kay S. had a rather interesting ping-pong in which one of them mentioned
160 > the concern that Red Hat and an init implementor for them had about all
161 > of this at the enterprise level. For those interested in such things,
162 > it's worth going back and looking at that if you skipped it (either find
163 > the link here or just go back and look at gregkh's G+ from ~April). I
164 > knew there were enterprise implications, but that was the first time I
165 > realized that RH wasn't necessarily 100% onboard with the full systemd
166 > thing, addressing it "upstream" since AFAIK Lennart is a RH employee as
167 > well.
168 >
169 > From that, it looks like they're more or less waiting for things to
170 > settle down as well, and they plan on some perhaps major patches being
171 > necessary for the first few RH releases with systemd. Of course, even
172 > assuming those patches eventually make it upstream, Red Hat's release
173 > cycle is long enough and their paying customers generally conservative
174 > enough, that it may be some time before they actually have to worry about
175 > supporting systemd in a deployed release.
176 >
177 > And of course, Ubuntu's continuing to stick to upstart for the time
178 > being, AFAIK. And CentOS and ScientificLinux being RH offshoots, they'll
179 > follow RH.
180 >
181 > In practice, I think that means that remote-hosted servers shouldn't have
182 > to worry about systemd issues for another couple years, anyway, gentoo or
183 > not. Of course if they run fedora, it might be a problem rather sooner.
184 > But people running fedora should be used to dealing with such leading
185 > edge issues, so no big deal for them either, really.
186 permit me to be worried anyway, systemd seem to going the "mutually
187 exclusive" route, while enterprise customers benefit from backporting of
188 fixes and rarely new versions added, gentoo does not.
189 >
190 > And given enterprise support terms, I guess we're looking at something
191 > approaching a decade before folks are actually FORCED to systemd, by
192 > falling off the end of the support train.
193 >
194 > Meanwhile, that gives plenty of time for other "entrprisish" parties to
195 > wait for redhat to decide what it's doing, then come up with their own
196 > solutions once a bit more about the ultimate target is known. And until
197 > then, except for those choosing to run fedora or the like, the existing
198 > live-media-style remote rescue solutions should continue to work as they
199 > have.
200 >
201 > And in particular for gentoo users with remote hosts to worry about,
202 > since it's already clear that for at least the near term (say a year or
203 > two), gentoo's going to continue to default to openrc, there shouldn't be
204 > a problem for at least /that/ long. And by the time any such problem
205 > /were/ to appear, it's very likely that solutions for it will be
206 > available as well... or given the day jobs of various gentoo devs,
207 > there'd certainly be sufficient interest in continuing systemd-
208 > alternative gentoo support, since they have similar issues themselves.
209 >
210 hopefully