Hacker News new | ask | show | jobs
by makomk 4262 days ago
I'm not sure it's exactly a fair comparison though; the right-hand file is shorter and simpler largely because they've split the work of the old init script across at least three files: the one shown, /etc/mail/make (which presumably now contains the messy preparatory work that made up most of the old init file), and sm-client.service. You could do that with traditional init if you wanted.
2 comments

And the only thing keeping that from happening with traditional init is someone submitting a patch against the package to split up the functionality of the init script into more distinct subunits.

It's interesting to note that no patch has been submitted against the sendmail package, most likely because it's unnecessary. And the only reason that the logic was moved to separate subscripts called in ExecStartPre entries for systemd is because systemd doesn't have a language to express those things in, so they need to be subscripts in order to have that capability at all.

One of the things which also bothers me about systemd is that it sort of "hides" things though layers of abstraction, compared to the shell scripts at least. For example, it is not immediately clear to me what effect "Type=forking" will have. It might not be so bad in this example, but it seems like this can wind up being quite complicated in some cases.

FreeBSD has a somewhat better simplification in my opinion using a common rc.subr file, which is included in many init scripts and can easily be reviewed by anyone editing an init script.