Gentoo Archives: gentoo-user

From: Victor Ivanov <vic.m.ivanov@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Question about runlevels.
Date: Thu, 18 Mar 2021 18:54:49
Message-Id: e2f12305-e3b7-0359-3b9d-4c177cccb853@gmail.com
In Reply to: [gentoo-user] Question about runlevels. by Grant Taylor
1 On 18/03/2021 18:36, Grant Taylor wrote:
2 > Do services started in the "boot" runlevel continue to run in the
3 > "default" runlevel?
4 >
5 Yes
6
7 > Or do they get stopped as part of transitioning from the "boot" runlevel
8 > to the "default" runlevel?  (Or any other runlevel that doesn't include
9 > the service.
10 >
11 Generally yes, when changing from one runlevel to another OpenRC will
12 stop all services from the previous (current) runlevel and start the
13 services for the next (new) runlevel.
14
15 However, my understanding is that the `boot' and `sysinit' runlevels are
16 "special" and services started there are also included in all
17 "non-special" runlevels.
18
19 In your case, `myService-boot' should remain active in `default' along
20 with `myService-default'. You can double check that by running
21
22 $ rc-status
23
24
25 > I'm wondering about having two things that are very similar (as in use
26 > the same ports), but distinctly different (different configurations)
27 > with the following:
28 >
29 ...
30 > My expectation is that OpenRC will (try to) start myService-default when
31 > the system enters the default runlevel.  But it will fail if
32 > myService-boot is still running.
33 >
34 It's difficult to say without understanding what they do and their end
35 goal. It also depends on how the services are coded. If they try to bind
36 to the same port then yes, chances are that `myService-default' will
37 fail at this point as the former would still be running.
38
39 If that's the case, one option is to separate their responsibilities
40 and/or make `myService-default' depend on `myService-boot' and have it
41 leverage whatever it is that `myService-boot' already provides.
42
43 - V

Replies

Subject Author
Re: [gentoo-user] Question about runlevels. Grant Taylor <gtaylor@×××××××××××××××××××××.net>