Rethinking PID 1 (2010)
0pointer.de
0pointer.de
For example, on the latest Fedora sshd/nginx/php-fpm still bind their listening sockets themselves rather than receiving it from a process manager. Similarly, if one wants to implement a socket activation in Go, it is not a one-liner that just works, but it requires a third-party library to read the socket passed over stdin.
As a result if for performance/security reasons one needs to customize few service socket parameters, then at best one need to look at application-specific configuration language for socket customization and hope that the developers have not forgotten to expose the socket option that is needed. At worst one uses LD_PRELOAD and similar atrocities to customize the sockets.
Also, we're all collectively still thinking of containers in terms of tiny-VMs instead of highly customized, tcp processing daemons, aka. websites.
One can workaround that using systemd-run utility to start long-running operation, but that is a privileged operation. Besides, it violates one of the premises of socket activation that it should be completely transparent.
But I never followed the topic that closely, so I'm honestly curious. Looking back on this, he makes a pretty compelling case for his ideas. Were the objections to systemd mainly disagreements with the concepts (parallelizing socket services, etc)? Or was it more the way the ideas were implemented in systemd that traditional sysadmins didn't like? (binary "registry-like" config files, etc)
I only ask because, if most objections were about the implementation, then it should be possible to create a system that achieves the benefits he's extolling here, while keeping a lot of the "Unixy feel" that his detractors prefer. If it's a more fundamental disagreement, then it's harder to see a path that could make both sides happy.
For example, it has its own syslog replacement, login manager, dbus implementation, network connection manager, dhcp server, udev implementation, boot manager, etc. There's talk of making it a dependency of Gnome, which would make Gnome and its components impossible to run on systems without systemd.
This is my main complaint. Most programmers know that coupling separate components is a bad idea[0]. After a while, the two components merge; they will begin to interface to lower and lower levels of each other, with the result being a giant mass of interdependent spaghetti code.
Your choice of desktop manager should not, in any way, dictate which init system you use. And with system taking udev and everything else with it, it may be almost impossible to separate out systemd ever again.
[0] I was going to link to the Stevens paper, but even wikipedia has an article about the problems of coupling: https://en.wikipedia.org/wiki/Coupling_(computer_programming...
Seems to me that while unix (and thus Linux) have traditionally leaned towards data or stamp coupling, while systemd is over at common coupling.
Consider this, upower now is pretty much a wrapper of logind.
- They say "We are creating X!"
- People say "Hey, X would be great!"
- They deliver Y, that technically is X, but only technically.
- People say "WTF! Y is very bad."
- They argue "That's why we did X, not Y."
I'm sure systemd developers believe it is the best way to do what is described on the article. But nobody asked for a completely tangled Linux startup.
Just FYI, systemd doesn't use and has never used binary config files. No idea where that myth came from.
Its configuration is actually less bad than modern Gnome etc., but is still a great increase in complexity.
A better init system was needed. A better init system is still needed. The trojan horse of systemd definitely wasn't needed. Hopefully it will spin off into its own OS at some point to compete with Ubuntu(sic)'s userland on top of Windows and leave GNU/Linux to develop something that is less of an annoyance.
Barrels of ink have been spilled on this point. You need to read the discussion surrounding this topic to understand that only the most ancient or poorly maintained RC systems were piles of redundant, buggy shell scripts. :)
I agree that it doesn't mean that rc scripts can't be written properly, but it is a rare occurence on many distributions.
Some issues that I've had with SysV init scripts that disappear with systemd :
* a service having different fd limits when started manually than when started at boot because ulimit values leak from the shell from which you call the init script to mysqld
* a service suddenly having encoding problems because the person who restarted it used a different locale than the one who initially started it and the environment leaks
* countless scripts that fail to properly kill the process
* restart methods that randomly work because it tries to start the new process while the old one hasn't been killed
And all of those on popular distributions. All of those problems go away with systemd.
Not saying it's the ultimate solution to everything, it has it's faults and I'm open to considering other systems but SysV init had to go.
As I mentioned, this has been discussed widely elsewhere and I'm disinterested in engaging in rehash #1,020,102 of the same tired topic. But, to summarize:
* If your service requires non-trivial work done as part of startup, reconfigure, or shutdown, you must use a script or other external program to get that work done as systemd's unit files will not provide the features required to help you.
* Services that require complicated actions as part of startup, reconfigure, or shutdown will necessarily have complicated code to handle those actions. There is no way around this.
* Only on systems that used both SysV init and SysV RC did you find that gobs and gobs of copypasta. Every distro I've seen over the past decade+ has factored out common functionality into libraries and kept copypasta in the distro-supplied init scripts to a bare minimum. [0]
> ...I'm open to considering other systems...
Check out OpenRC. The minimal service management script isn't much larger than the equivalent systemd unit file and is no more difficult for a complete newcomer to read.
[0] Can you find egregious examples of copypasta and/or scripts that handle edge cases poorly? Sure. But you can find that stuff in any sufficiently large sample of code. Additionally, pushing the required startup scripting out from the distro maintainers to the maintainers of each individual project seems like it greatly increases the chance that a given wheel will be reinvented.
* http://homepage.ntlworld.com./jonathan.deboynepollard/Softwa...
The buggy script problems: trusting the .pid file too much amongst other things.
Yeah, I'm quite familiar with the poorly-informed pro-systemd and anti-systemd arguments. I'm also fairly familiar with a variety of init and RC systems and have -thanks to vezzy-fnord and others- learned waaay too much about the history of <star>nix init/rc systems. (There's a lot of wacky stuff out there!)
Cheers, man!
With that in mind, what would a better init system look like for you? systemd-lite, with lots of the questionable feature creep removed and really brought back to it's PID1 beginnings? Something back to sysvinit with it's configuration-as-code, but with modern languages and a general freshen up? Or something else entirely?
It's previously been very hard to get meaningful discussion about this (on both sides of the divide!) because each side is so highly polarised.
I'm not the OP, but OpenRC is nice. I'm currently suffering from a round tuit shortage, so I haven't waded through the Debian Jessie discussion to find out why it wasn't a contender for their default init/rc system.
It was a contender; it appeared on the Technical Committee ballot alongside sysvinit, upstart, and systemd. Seven of the eight members of the technical committee indicated a preference for OpenRC over sysvinit, just not over upstart or systemd.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=6729;bug=7... for the results of the vote.
[1] https://news.ycombinator.com/item?id=11601288
[2] Arch Linux for long, nowadays FreeBSD
And with a sane RC system, such as OpenRC (which technically is still SysV init, but who cares about the init process.. it doesn't do much really), I would argue the scripts are on the same level of complexity as systemd unit files for most cases (so it would be fine to use either).
But for more complex applications, such as mounting crypto devices or network configuration, these two do depart a fair bit. Systemd chose to not go the way of simply wrapping the cryptsetup command, but talk directly to the kernel, which would be fine or even better in theory, but has the slight drawback of reducing (as far as I could tell) all error conditions to Invalid Argument (which took me then quite a bit of effort to find out what I had done wrong). Systemd-network(d?) suffers from the same problem (doesn't use the iproute2 command, but directly speaks to the kernel) in my opinion - again it is only really useful for the most common use cases, uncommon ones become impossible (because certain iproute2 features are simply unsupported as of yet) or really difficult to debug (because you are debugging an application interpreting configuration files instead of simple shell scripts).
[1] http://smarden.org/runit/dependencies.html [2] http://www.voidlinux.eu/usage/runit/
If I don't want to use it, I should be able to swap it out. I shouldn't have to patch Gnome, udev, and whatnot to not use systemd.
I don't have problems with systemd, what I feat is essential parts of GNU and Linux infrastructure becoming directly dependent on it, at the actual software level.
The conflict here is pretty easy:
* People not wanting to avoid anything from systemd project
* Maintainers simplifying their project by relying on an API
The API they're relying on is not init system specific, but because it is provided by the systemd project, there's non-technical hate against the decision. Outcome: maintainers ignore those people as they're irrational.At the end of the day, I've left GNU/Linux behind anyways, I'm not talking for myself but for the community.
EDIT: flicked through the article and yup, it's 2010 and systemd is announced: "You probably guessed it: what I suggested above as requirements and features for an ideal init system is actually available now, in a (still experimental) init system called systemd, and which I hereby want to announce."
2016 and I'd still say it's mostly experimental, but unfortunately reached production machines now.
I don't understand the hate that systemd seems to bring in people. It may not be perfect but the good largely outweights the bad and anyway most of the arguments against it are the same copy pasted critics from day one, when they aren't pure name calling against its author.
From a user perspective I for one am glad to be able to start and kill services in a reliable maner, to have structured logging and a set of base system components that are simple to use, coherent and well documented and make taking advantage of otherwise painful to use Linux features easy.
Most anti-systemd people seem to be adverse to change and would rather stay on SysV init, but seriously how much longer are we expected to stick with that symlink mess of ugly scripts that can't reliably start a service in a reproducible environment or track which process belongs to which service ?
I often see anti-systemd people advocate a move to FreeBSD, but there is a reason behind the existence of the nosh or launchd projects... BSD init might be cleaner than SysV but it suffers from some of the same problems.
The age of an argument doesn't negate the argument, especially if it has not been effectively addressed since it was first proposed.
Those arguments are copy and pasted because they are still solid arguments and they have been pretty much ignored or handwaved away.
That you're tired of hearing them doesn't mean that they shouldn't be addressed. Those making the arguments are getting tired of having to repeat them—just like the tech industry is tired of having to continuously debate the government on cryptography: the arguments for liberty still stand, despite being codifed two centuries ago.
What's the best single page summary along with adequate details of the arguments against systemd, and what's the professed alternative? From Googling around, I haven't found anything with a comparable level of technical quality, depth, and concreteness.
However, it stood out that the shell scripts are complex and buggy in edge cases. Quite opposite of robust programming we normally want. The socket activation trick is nice. I could see following Systemd's lead to improve in those two areas with a regular, minimalist init. Other features in other processes. See where that goes before letting one component go octopus on everything else.
Had to do some long shifts before digging it out. Not sure why you deleted it given it was a decent question. Still "self-censoring?" :P Anyway, you can email my profile address about it if still curious on technical angles and such.