1 |
On Wed, Dec 21, 2016 at 8:36 AM, Corbin Bird <corbinbird@×××××××.net> wrote: |
2 |
> |
3 |
> The old manual method of configuration is extremely flexible, you can |
4 |
> get the "who-knows-where-it-came-from-component" to work. The new |
5 |
> "automagic" of udev / systemd .... forget it. At least with script based |
6 |
> init systems I could change the run level to fix Xorg problems. |
7 |
|
8 |
udev and systemd operate based on text configuration files that are |
9 |
declarative in nature. |
10 |
|
11 |
You can certainly change the "run level" in systemd (what you'd call a |
12 |
runlevel in openrc would be a target in systemd). You can even pass |
13 |
the default target on the kernel command line, or change the default |
14 |
target in /etc. As with openrc they aren't numbered and you aren't |
15 |
limited to any particular number of them. There are some standard |
16 |
ones out of the box, like multi-user, emergency, getty, basic, etc. |
17 |
|
18 |
> |
19 |
> The systemd configuration files are designed for programmers, not |
20 |
> technicians. And their is a HUGE difference between "programmers" and |
21 |
> "technicians". Different aptitudes, different skills. The old .conf |
22 |
> files, technicians can easily handle. Requiring everyone to be a |
23 |
> programmer is a really bad idea. |
24 |
> |
25 |
|
26 |
The only "configuration" files openrc supports for services are shell |
27 |
scripts, as opposed to declarative configuration files used by |
28 |
systemd. Now, openrc init.d shell scripts might source configuration |
29 |
from some text file in /etc/conf.d, but there is nothing that prevents |
30 |
systemd units from doing the same. On Gentoo we stick the settings in |
31 |
drop-in files instead, but these are no more complex. |
32 |
|
33 |
Here is an example of a Gentoo systemd drop-in: |
34 |
/etc/systemd/system/ntpdate.service.d/00gentoo.conf |
35 |
[Service] |
36 |
Environment="SERVER=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org |
37 |
2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
38 |
|
39 |
|
40 |
That hardly requires programming to understand. |
41 |
|
42 |
|
43 |
And here is the entire ntpdate unit file: |
44 |
/usr/lib/systemd/system/ntpdate.service |
45 |
[Unit] |
46 |
Description=Set time via NTP using ntpdate |
47 |
After=network-online.target nss-lookup.target |
48 |
Before=time-sync.target |
49 |
Wants=time-sync.target |
50 |
Conflicts=systemd-timesyncd.service |
51 |
|
52 |
[Service] |
53 |
Type=oneshot |
54 |
ExecStart=/usr/sbin/ntpdate -b -u $SERVER |
55 |
RemainAfterExit=yes |
56 |
|
57 |
[Install] |
58 |
WantedBy=multi-user.target |
59 |
|
60 |
|
61 |
No programming there either. |
62 |
|
63 |
Most of the stuff that is hard to understand in the file are the |
64 |
dependencies, and that is just because you need to learn the |
65 |
terminology that systemd uses, though most of that is straightforward. |
66 |
The After= line is roughly equivalent to "use net dns" in openrc, |
67 |
though systemd has a lot more virtuals defined out of the box and |
68 |
they're more granular. For example, systemd distinguishes between an |
69 |
interface existing, and an interface having an IP/etc, while on openrc |
70 |
we have just one virtual that covers the latter. |
71 |
|
72 |
I know, it almost sounds like the systemd design is intended to |
73 |
support running a diverse service ecosystem. Go figure... |
74 |
|
75 |
-- |
76 |
Rich |