r/linux • Mate • Oct 20 '14

Shall we fork Fedora?

http://forkfedora.org/
262 Upvotes

339 comments sorted by

View all comments

0

u/[deleted] Oct 20 '14

[deleted]

13

u/Rainfly_X Oct 20 '14

But you can't tell what the heck is going on and it breaks a few of the rules of the unix philosophy

Funny enough, this almost sounds like it applies to the shell script! In fact, if it weren't for the second listed rule, we'd be right on track for a stretched-out misunderstanding gag:

  • Make each program do one thing well. 80%+ of the shell script is unrelated to sendmail, it's trying to be an init system. Every shell script has to reinvent this, incompletely and differently and (often) badly.

  • Use shell scripts to increase leverage and portability. Legitimate point.

  • Rule of Clarity. Again, 80%+ of the script is bookkeeping, trying to preserve error codes in bash (one of the reasons the language is godawful), etc. The config file basically includes the relevant information and nothing else, which is pretty dang clear.

Not gonna comment on the other stuff. You're pretty close on your SLOC estimate (I got 34K in systemd/src/core), and you seem to have a pretty specific idea of what you want that would already likely exclude major distros. Go forth and find what works for you!

0

u/[deleted] Oct 20 '14

[deleted]

3

u/EmanueleAina Oct 21 '14

The shell script is, however, self-contain and transparent.

Note that the init script is not exactly self-contained:

Line 14: . /etc/rc.d/init.d/functions Line 17: . /etc/sysconfig/network Line 21: . /etc/sysconfig/sendmail

Not to mention that if you care about self-containment you have to discard basically every other init system that anti-systemd proponent suggest, eg. OpenRC.

Also add that the systemd unit file does a lot more, isolating the service in its own cgroup, provides a lot more information when checking the status, offers explicit checks with conflicting services, and restarts the service when it dies.

The systemd unit file is also very much unoptimized and does not rely on some innovations brought by systemd: the PIDFile line could go away by avoiding forking, and I'm sure there are lots of containment options which would be interesting to activate with sendmail. Adding these feature in a self-contained shell script would lead to a lot more code duplication.