1 |
Several issues not related to the original have been brought up, which I |
2 |
will briefly respond to, but let's try to move back to the original |
3 |
issue I brought up, which is whether the early loop solver should break |
4 |
loops or just output messages about them. |
5 |
|
6 |
On Thu, Dec 04, 2014 at 07:12:58PM +0300, Andrew Savchenko wrote: |
7 |
> Hello, |
8 |
> |
9 |
> On Thu, 4 Dec 2014 08:59:22 -0500 Rich Freeman wrote: |
10 |
> > On Thu, Dec 4, 2014 at 7:54 AM, Andrew Savchenko <bircoph@g.o> wrote: |
11 |
> > > |
12 |
> > > 1. There are multiple services having "after $all" statement (an |
13 |
> > > analog in Gentoo is "after *", which is currently used only by |
14 |
> > > local init.d script). |
15 |
> > > |
16 |
> > |
17 |
> > Seems to me that the solution to this is to ban this sort of syntax |
18 |
> > entirely, and use proper deps. |
19 |
|
20 |
I agree with this. As soon as more than one service tries to use |
21 |
"before/after *", things are broken, because more than one service can't |
22 |
possibly meet those dependencies. |
23 |
|
24 |
> |
25 |
> There is no serious problem in Gentoo here, because local is _the |
26 |
> only_ service that uses this kind of dependency. But in Debian |
27 |
> "after $all" syntax is in common use and we can't change that. |
28 |
|
29 |
I am chatting with qnikst on irc as I write this, and he says this might |
30 |
be able to be solved by stacked runlevels. I haven't looked at this |
31 |
myself yet so can't verify. |
32 |
|
33 |
> The prime cause of these patches was to bring OpenRC as usable init |
34 |
> system for other distributions and not to limit its scope only to |
35 |
> Gentoo. And Debian has requirement of additional features in order |
36 |
> to allow OpenRC to be used as a reliable replacement of other init |
37 |
> systems. |
38 |
|
39 |
A dependency checker is something we have needed for some time, |
40 |
regardless of the distro; you are talking about bug 391945 [1]. |
41 |
|
42 |
The lsb support is a temporary measure until |
43 |
Debian can move away from lsb init scripts, which is their plan, so I |
44 |
don't think we need to worry about it upstream. |
45 |
|
46 |
> > WHY do we have to run local.d last? |
47 |
> > Why do we have to run any of that other stuff last? |
48 |
> |
49 |
> I doubt this is in POSIX standard or whatever, but it is a quite |
50 |
> common custom among distributions to have some rc.local service |
51 |
> where admins may put their custom daemons to be started in quick and |
52 |
> dirty way, so that admins without prior knowledge of how particular |
53 |
> init system works may put their stuff to that rc.local script/ |
54 |
> service/whatever. This is mostly needed when out-of-tree packages |
55 |
> are used or in-tree packages lack init script. The former is quite |
56 |
> common in production, unfortunately. |
57 |
|
58 |
I am not planning on changing this; I want to keep local running last. |
59 |
|
60 |
> > > 2. LSB dependencies are allowed to be asymmetrical relative to start |
61 |
> > > and stop, while in OpenRC they are symmetrical. This yields to |
62 |
> > > loops in OpenRC while in LSB the same services work fine. Example |
63 |
> > > follows: |
64 |
> > |
65 |
> > Seems like the solution to this is to allow a different syntax for |
66 |
> > start vs stop dependencies then, with the default being to keep them |
67 |
> > the same if the current syntax is used. |
68 |
> |
69 |
> Yes, this particular case can be solved with optionally separated |
70 |
> start and stop dependencies. |
71 |
|
72 |
This is a separate thread; I would like to know more about this before I |
73 |
attempt to implement it, including what the use cases are for it. Let's |
74 |
table this one for now. |
75 |
|
76 |
> What proposed solutions do? |
77 |
> |
78 |
> 1a. For the first issue early loop solver allows to start all |
79 |
> services from a *soft* loop gracefully, so that all services should |
80 |
> work, because all mandatory "need" dependencies will be satisfied. |
81 |
> |
82 |
> 1b. If loop is *hard*, then later loop solver will intelligently |
83 |
> break loop at some point, so that as much services as possible will |
84 |
> have their "need" dependencies satisfied. Of course, some services |
85 |
> may fail in this case, but this is still better than fail _all_ of |
86 |
> them. |
87 |
> |
88 |
> 2. No time will be lost in case of *soft* loop and time loss will |
89 |
> be minimized in case of *hard* loop. |
90 |
|
91 |
Later loop solver is not even under consideration. The author made it |
92 |
very clear that it shouldn't be; read his comments about it not being a |
93 |
good solution in the pull request [2]. In fact, I think he meant to |
94 |
close it (see comment 2) so I am going to do that today. |
95 |
|
96 |
> |
97 |
> > > So it is a statement of fact that OpenRC |
98 |
> > > should be compatible with LSB dependencies. |
99 |
> > |
100 |
> > It seems to be a statement of fact that OpenRC ISN'T compatible with |
101 |
> > LSB dependencies. What it "should" be is anything but a statement of |
102 |
> > fact, which is what the word "should" means... |
103 |
> |
104 |
> Yes, it is not compatible now. And if OpenRC wants to step out of |
105 |
> Gentoo scope to other distros, it should be. But as one can see, |
106 |
> Gentoo will also benefit from proposed fixes, which will made OpenRC |
107 |
> init system more robust and error-prone. |
108 |
|
109 |
We are talking about two issues; I did not mean for the lsb support to |
110 |
get into this thread. I was just wanting to discuss the early loop solver. |
111 |
|
112 |
> > I don't get why Gentoo gets by just fine with things as they are, but |
113 |
> > nobody else apparently can. Just fix your dependencies. |
114 |
> |
115 |
> I don't have broken dependencies on my systems right now. And this |
116 |
> is not a discussion of my personal issues at all. What I'm trying |
117 |
> to do is to make OpenRC robust and resilient to errors which may |
118 |
> occur as well as expand its scope outside of Gentoo as a mature |
119 |
> init system. |
120 |
|
121 |
Being error-resistant is a good thing, but the issue with breaking |
122 |
dependency loops without human intervention is we can't be sure we are |
123 |
breaking them in a sane way. |
124 |
|
125 |
> > > Warnings for users about loops is a good idea for Gentoo, but will |
126 |
> > > produce a lot of not always wanted output on Debian, that's why |
127 |
> > > this option should be configurable. |
128 |
|
129 |
I'm not completely opposed to it being configurable. However, I am |
130 |
opposed to the configurability being implemented the way it is in the |
131 |
patch, because it breaks the public API for what I see as a minor gain, |
132 |
if it is a gain at all. |
133 |
|
134 |
This output is complaining about a pretty important issue, so in my |
135 |
mind, if I compare the configurability to the loop solver, the |
136 |
configurability is a far lower priority. |
137 |
|
138 |
> > |
139 |
> > I'd call these situations errors - a warning should certainly be used. |
140 |
> |
141 |
> They are errors in Gentoo, but in some cases are normal in Debian, |
142 |
> because dependencies are asymmetric there. That's why switch to |
143 |
> omit them was requested. |
144 |
|
145 |
I, too, see these as errors. Also, like I said above, a discussion about |
146 |
asymmetric dependencies is a good thing, but let's put that on a |
147 |
separate thread later. |
148 |
|
149 |
For more ways to control how services stop/start/deal with the timeout |
150 |
issue, you might want to look up the -stop and -timeout keywords in man |
151 |
openrc-run. |
152 |
|
153 |
William |
154 |
|
155 |
[1] https://bugs.gentoo.org/show_bug.cgi?id=391945 |
156 |
[2] https://github.com/openrc/openrc/pull/13 |