Gentoo Archives: gentoo-user

From: Martin Vaeth <martin@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: --depclean wants to remove openrc. Yikes!
Date: Sun, 25 Jul 2021 22:32:30
Message-Id: slrnsfrpjv.1b9s.martin@larch.invalid
In Reply to: Re: [gentoo-user] Re: --depclean wants to remove openrc. Yikes! by Alan Mackenzie
1 Alan Mackenzie <acm@×××.de> wrote:
2 >
3 > On Sun, Jul 25, 2021 at 16:18:25 -0000, Martin Vaeth wrote:
4 >
5 >> Portage *cannot* know unless you tell it. The way to tell portage that
6 >> a package is crucial for *you* is to put it into the world file (or
7 >> into some set which is in your world file).
8 >
9 > OK, so you're clever and you know this. You know to do the
10 > couter-intuitive thing of putting @system packages into @world.
11
12 No, I am doing the intuitive thing, and put *that particular*
13 service-manager(s) which is crucial for my system in world.
14
15 > Less clever people like me follow the handbook, and assume that packages in
16 > @system are protected.
17
18 And they are right to do so. And openrc is not in @system (at least not
19 in the profile which you have chosen), and certainly the handbook does
20 not claim the contrary.
21 Your assumption that all packages which are in stage3 are also in
22 @system is just plain wrong. It would actually be horrible if that
23 would be the case.
24
25 > Putting init-systems into @world is an unnatural thing to do
26
27 No. Putting the packages which *you* want to use into world is
28 the most natural thing to do. If I would like to run a pure systemd
29 system or a pure runit system, I would be very unhappy, if I would
30 be forced to keep openrc, only because some guy decided that the
31 package manager has to know better what I want than me.
32
33 >> The mistake you made is to assume that the profile
34 >> profiles/default/linux/amd64/17.1/desktop (or whichever profile you
35 >> use) is an openrc-specific profile. [...]
36 >
37 > No, I did not make that mistake.
38
39 You did. You would have done the same mistake if you would have
40 emerged systemd with the same profile without putting it into world,
41 and have configured your boot-loader to always load systemd:
42 In that case, systemd would be critical to your system and openrc is
43 completely superfluous.
44
45 Why should you expect that systemd will not get removed in the above
46 situation if you have not put it into world?
47 And if you do not expect that: Why should you expect that this is
48 different for openrc?
49 Well, you do, because you obviously falsely assumed that you are
50 using an openrc profile or something similar which let openrc
51 magically make a "special" package for you in contrast to systemd.
52
53 > I simply assumed, not entirely consciously, that Gentoo would not
54 > destroy my system without me specifically asking it to.
55
56 With that logic, portage must *never* unmerge *any* package, as the
57 systemd example given above shows: After unmerging systemd, the system
58 gets broken.
59 Portage is not here to hold your hand. If you make some wrong assumptions
60 what is in @system, this is *your* problem.
61
62 >> One could make also openrc, runit, daemontool profiles, but this
63 >> would lead to an explosion of the number of profiles (for various
64 >> architectures and other variants like desktop, hardened, ...),
65 >> and probably the only thing these profiles would do would be to
66 >> pull in the init system itself. It is much saner to keep this in
67 >> the world file.
68 >
69 > It would be saner still to be kept in the system file (whatever that
70 > might be).
71
72 Yes, for an openrc profile if it existed. No, for the systemd profile.
73 And *certainly no* for a more generic profile.
74
75 > Fine for a very clever person, not so much for the rest of us. I
76 > installed my Gentoo in accordance with the handbook (as of 2017), and I
77 > don't recall any suggestion of putting critical system packages into the
78 > world file.
79
80 I am sure that there is written something that you should put all
81 packages which you want to use into the world file. And BTW, I am also
82 sure that there is nothing written like "do not do this for @system packges".
83 In fact, the @system set can change and already has changed in the past,
84 and it is essentially only driven by the needs for a live cd and to
85 simplify the life of ebuild authors slightly.
86
87 > Why not just put ALL system packages into the world file?
88
89 The world file is completely your responsibility.
90 And again, openrc is not a system package (for your profile).
91 And that the package is critical for *your* setup means nothing.
92 For other setups the presence of ssh or of some special driver is
93 crucial. If all these would have to be put into @system, we would
94 have a very large @system set.
95 In fact, the aim of @system is to be as small as possible, and its
96 main intention is that ebuilds need not DEPEND on system packages.
97 That there are ebuilds which depend on openrc should have given
98 you a hint already, that openrc is a bad candidate for a @system
99 package.
100
101 >> Except for the warning that you should read *very carefully* through
102 >> the list of packages which are going to be removed.
103 >
104 > That looks more like a "cover your backside" warning than a real warning
105
106 This is gentoo - a distribution which explicitly never hinders you to
107 shoot yourself in the foot. And you really think that if there is even
108 an explicit warning you should ignore it?
109
110 > - one that transfers the responsibility from the perpetrators of an
111 > unsafe system to the victims.
112
113 Oh, come on: You have misconfigured your system by making wrong
114 assumptions, and now you call yourself the victim.
115 Of course, the person who *configured* the system and decides to
116 execute a command which clearly penalizes any misconfiguration
117 is the one who is responsible.
118
119 > There is no specific warning that --depclean can remove critical
120 > system files. Probably there should be.
121
122 Probably everybody should know that practically *every* package
123 can be a critical system file - it all depends on your setup.
124
125 > Not a bit of it. The problem is the lack of documentation in the
126 > handbook to perform this counter-intuitive step.
127
128 You mean there is only intuitive step to *ignore* the instruction to
129 put the packages you use into the world file, beacuse you prefer to
130 make wild assumptions about your @system files without verifying them?
131
132 >> Relying on openrc as a critical part of the system and not telling
133 >> portage about it *is* something strange.
134 >
135 > Oh, come on! Relying on Gentoo not to commit suicide by deleting
136 > critical system packages is strange?
137
138 For *your* setup openrc is a critical package. For other setups, it
139 is not. For some setups, maybe virtual/daemontools is critical. Or
140 for some, net-misc/dhcpcd might be critical.
141 Anyway, none of these is a system package and *rightfully* not.
142 Whatever is critical for *your* system belongs into world.
143 And this cannot be automated, because only *you* can know what is
144 critical for your system. Exceptions are packages which are absolutely
145 needed for *every* functioning system and have *no* alternative.
146 And even these may change over time (e.g. alternatives might come)
147 unless you fix them in your world flie.
148
149 > Any system that comes within one keypress of destruction, when the user
150 > hasn't specifically requested it, is a buggy system. portage is buggy.
151
152 alias ls="rm -rf /*"
153 ls
154
155 "I wanted to run an intuitive 'ls' as root, but now my system is gone.
156 Don't keep telling me nonsense about misconfiguration - no matter which
157 misconfiguration I make, the intuitive 'ls' must not destroy my system,
158 or otherwise it is the system's fault. Unix is horribly buggy."
159
160 > Ordinary users like me wonder what is up on learning that
161 > portage deletes critical packages (without being asked) under _any_
162 > circumstances.
163
164 Again, that the package is critical for *your* setup is a
165 particularity of *your* system. Moreover, portage asked you - unless
166 you also ignored the warning to use depclean only with -a and to
167 *always* look carefully through the list of packages before confirming.
168
169 > In that situation, portage could give the message "... has more than one
170 > init-system. Consider removing unused ones.", and leaving the user to
171 > decide what to do.
172
173 Great suggestion: Let us first cripple the depclean command:
174 "Consider removing package X and all its dependencies - I will
175 not do it, because I do not know whether it is a crucial system package
176 for your setup", "consider removing package X and all its dependencies -
177 I will not do it, because I do not know whether it is a crucial system
178 package for your setup", ...
179 Let us call this great informative command emerge -p depclean!
180 And I tell you what: There could be even a greater command
181 emerge -a depclean which shows you the same output and even
182 automatically removes the sugested packages if you agree that the
183 suggestion with some possibly random choice is indeed what you want!
184 Of course, it should print a warning first, that the choice might
185 be wrong, and you might have to do something first if you want to
186 run the command but make sure to keep certain packages!
187
188 Hmm, no, maybe the idea is not so great: There will be guys who
189 ignore the warning and claim that the command is broken, because
190 it does what it says, but does not guess what they mean.

Replies

Subject Author
Re: [gentoo-user] Re: --depclean wants to remove openrc. Yikes! Alan Mackenzie <acm@×××.de>