1 |
On 02/09/2016 01:17 PM, Rich Freeman wrote: |
2 |
> On Tue, Feb 9, 2016 at 3:43 AM, Kent Fredric <kentfredric@×××××.com> wrote: |
3 |
> |
4 |
>> And a lot of Gentoo is surprisingly simple: Like our use of bash |
5 |
>> scripts for recipies to build things, like using rsync to deploy/relay |
6 |
>> not just those recipies, but security notices and news items, which |
7 |
>> are themselves reasonably simple formats. |
8 |
> Well, one thing about Gentoo that certainly isn't simple is our init.d scripts. |
9 |
> |
10 |
> Compare this: |
11 |
> http://pastebin.com/sSDtpF4t |
12 |
More stable link: |
13 |
https://gitweb.gentoo.org/proj/apache.git/tree/2.4/init/apache2.initd |
14 |
> |
15 |
> With this: |
16 |
> http://pastebin.com/Lfn8r7qP |
17 |
More stable link: |
18 |
https://gitweb.gentoo.org/repo/gentoo.git/tree/www-servers/apache/files/apache2.2.service |
19 |
> Systemd does the job in 10% of the code (and half of it is a comment), |
20 |
> and doesn't implement its own service polling and killer script during |
21 |
> shutdown independently for every service (not that every init.d script |
22 |
> even does this - most of them will just leave orphans behind, and |
23 |
> systemd will catch orphans that even the lengthy init.d script for |
24 |
> apache misses). |
25 |
> |
26 |
Right, that's a bad comparison. |
27 |
|
28 |
The equivalent OpenRC init script is: |
29 |
|
30 |
``` |
31 |
#!/sbin/runscript |
32 |
command="/usr/sbin/apache2" |
33 |
command_args="${APACHE2_OPTS}" |
34 |
description_reload="A graceful restart advises the children to exit |
35 |
after the current request and reloads the configuration." |
36 |
|
37 |
stop() { |
38 |
$command $APACHE2_OPTS -k graceful-stop |
39 |
} |
40 |
reload() { |
41 |
$command $APACHE2_OPTS -k graceful |
42 |
} |
43 |
``` |
44 |
So that's almost exactly the same (modulo braces and newlines). There's |
45 |
no equivalent for PrivateTmp, and we ignore the extra data in |
46 |
/etc/tmpfiles.d (for creating runtime dirs). Which is bad, but that's |
47 |
another rant ;) |
48 |
|
49 |
Just that the current initscript does a lot more, and ... uhm ... why is |
50 |
the systemd unit sourcing /etc/conf.d/apache2 ? |
51 |
(Oh, and dependencies, but those just slow down startup <trollface/>) |
52 |
|
53 |
So if you compile the equivalent naive init script there's not much |
54 |
difference, and the initial argument falls on its face and disappears. |
55 |
|
56 |
I'm getting tired of having this argument :) |