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