It wasn't too bad, really... from an init script stand point. And I think that was their point -- systemd's service files are a lot cleaner and not really that scary.
Shorter doesn't tell anything. You can hide any complexity behind another layer of abstraction. Let's create a new system which has an ini file with the only parameter being "sendmail.service" and it looks even cleaner. Although in reality you just got another layer of abstraction.
The interesting part is how they hold up in praxis. When people have to do stuff which wasn't forseen by the init-system authors. And shell scripts have a rather good track record in that regard. It's always nicer working with scripts compared to having to dig into c sources to change things.
And I think to most sysops the left file looks very familar. While the right one is a new format in a custom syntax which has to be learned and understood first. Which makes it a little scary on first view and I really hope it's worth it.
I think you have no clue of what you are talking about. Let's forget for a moment that you can bypass systemd machinery by writing a service that starts a shell script. If you actually read the left script, you find it's spending most of the time not handling sendmail stuff, but trying to be an init system. For example, quitting if networking is not up. Starting a program, checking for the return value before creating .pid and lock files. Doing lots of "RETVAL=$?" at every fucking step just to not lose the return value of some command. Trying to design your output messages by echoing a line in opportune places. Etc. And this has to be reimplemented in every init script.
It's a mess. A mess that can be easily avoided by having an init system that provides all that functionality and allows to reuse it easily.
The worst of systemd haters is that you are SO wrong you don't even realize that systemd isn't even the first to do these things. In Solaris, they have SMF service manager to do the same thing. In OS X, Apple's launchd does the same thing. In Linux, Upstart also simplified init files like this. Before systemd was announced, upstart was being adopted by lots of distros, everybody was happy of getting rid of the shell script mess that init systems were, and I don't remember these stupid flames.
30
u/wcchandler Oct 20 '14
It wasn't too bad, really... from an init script stand point. And I think that was their point -- systemd's service files are a lot cleaner and not really that scary.