Poettering: Why systemd?
Poettering: Why systemd?
Posted Apr 30, 2011 12:48 UTC (Sat) by neilbrown (subscriber, #359)In reply to: Poettering: Why systemd? by handock
Parent article: Poettering: Why systemd?
Maybe the aspect of "Unix philosophy" that is embodied in init scripts and horribly violated by systemd is to take a moderately good idea and to push it beyond its competence (as I believe was done with signals).
In this case the good idea is shell scripts. The "shell" is an incredibly useful language for doing a certain class of tasks, and an incredibly horrible language from any language-theoretic stand point. Correspondingly shell scripts are incredibly useful, but definitely the wrong way to try to create large maintainable systems.
Shell scripts are particularly good for quick prototypes. The "spell" command is a good example. It was originally a small shell script (cat $1 | tr -s '\011 ' '\012' | sort | uniq | comm -13 - /usr/dict/words) which then grew into a larger shell script which then became an unmanageably large shell script, which then became a compiled C program (was 'ispell' the first, or was there an earlier one?).
Shell scripts were an obvious and correct way to prototype the start-up of services at boot time, but surely we have reached the point where we can move on from the prototype??
From a completely different perspective, as the upstream maintainer for mdadm and (previously) nfs-utils, one of the biggest frustrations is/was that every distro has different init scripts for starting these services so it is very hard to provide support or fix bugs for issues that relate to the boot sequence. In particular there are very important ordering requirements for starting the various NFS related daemons. If you get some of them wrong you will hardly ever notice - until something breaks strangely in a rare-but-possibly situation (e.g. server restarts while client holds a lock). There was no way I could ensure that every distro got this right. The best I could do was document it as carefully as possible.
With systemd this becomes possible. I don't actually know if systemd starts NFS services, and I don't know if it gets it "right". But that is not the point. The point is that it is one standard tool - with the *right* concepts (like socket-based-dependencies) - which I could add the support to if needed, and could fix the support in if it were broken and then every distro that used systemd would get the fix.
I'm convinced that /etc/rc and then /etc/rc.local and then /etc/rcNN.d/ were the right things to do. But we have learnt useful stuff at each step and it really is time to move on - to grow up you might say.
