117 points · by tshepang · 13y ago · 102 comments
The distro maintainers package the software for their system. It's therefore also their responsibility to make sure a service can be started/stopped and have its status checked.
It does not matter what kind of init system a distro has. A single Linux distribution is an Operating System independent of all others. There is no one true portable Linux way, much less for non-Linux-based Operating Systems. You have to treat them all as separate because to do otherwise would not only add complexity to a monolithic "portability" system, it would eventually get so complex you'd have to split it up anyway.
Portable software makes 3rd-party software developers' lives easier. But the init system is not managed by 3rd-party developers. It is managed by the OS maintainers. So it does not matter what method they use.
Furthermore, it's fucking Debian, the second-oldest distribution still in release. The oldest (Slackware) holds onto the old ways for as long as technically possible, and they're still going strong. So why the hell they care about being "modern" and "remaining relevant" is anyone's guess.
(disclaimer: I wrote my own init system for my own Linux distribution, and have modified most others)
Oh, wait. I found it. From http://0pointer.de/blog/projects/why.html :
"Specialized professional consulting and engineering services available: yes"
The purpose of a lot of systemd was to say "there are these old utilities based on shell script hacks that would be better served in a Linux-specific framework" like power management, device plugging handling, etc. So they put them under one project. Same way under the Linux kernel is hundreds of megs of device drivers, and a lot of features end up in kernel space (rendering interfaces, networking stacks, filesystems, virtualization) yet nobody calls the kernel anti-unix (some might call it bloated, though).
> This blog post is the third of a series of posts
> dealing with the results of the Debian systemd survey
Previous posts in the serieshttp://people.debian.org/~stapelberg//2013/06/09/systemd-blo...
http://people.debian.org/~stapelberg//2013/07/01/systemd-tra...
I feel like Linux distros today come with too many crappy, overthought, over-engineered daemons that don't really offer much over the previously available interfaces. I guess parallelizing init scripts or making dependencies more explicit is a good thing in some sense, but I have to say, it's a breath of fresh air to see something like a *BSD system, which has an /etc/rc shell script that is easy to follow. Unlike Linux which frequently seeks out complex solutions from simple problem spaces.
Try doing something like "stop apache". It turns out that trying to simply kill the Apache processes isn't going to work right, as Apache forks out lots of worker processes that won't be guaranteed to be killed when the Apache process stops. And now since the parent has gone away, they're reparented to PID1, so there's all these worker processes littering your system.
systemd uses cgroups to tag every single forked out process with a service file, so that all of the processes associated with a service can be stopped at once.
Debian/kFreeBSD is an awesome idea, especially since FreeBSD's package system sucks and ZFS is unparalleled.
However, I don't think that's the only reason to avoid Systemd.
When I asked about the Hurd of FreeBSD versions of Debian, it seems that stuff has to compile against it. Every Debian maintainer has to already spend a lot of time on it, while the usage is pretty low.
Furthermore, it seems rarely useful. At most in the 'it compiles, but does not run, ship it anyway!' stage.
If people want Hurd or FreeBSD, then why not have them put in a bit more effort? Not like sysvinit will be completely broken.
I failed to see a reason behind this movement except of the "you're an old fart and this is how we're doing it today" explanation. And when BSD comes up and say this is not portable, everybody say we're on Linux and we don't care and you should jump the shark as we do. What?!
This statement doesn't seem to match the actual controversy, unless it was sarcasm.
What's with the /usr that should be mounted at start? What was wrong with /? And why should initd depend on the kernel?
sysvinit -> systemd = IE5 -> Chrome.
Sure, you can browse the web with IE5; if all your favourite sites work with it and they aren't changing, then you wouldn't see any reason to change either.
Meanwhile, a fairly significant number of people would like to be able to use the features in CSS3 / HTML5 - and while 75% of those features can be emulated in IE5 (with several megabytes of javascript libraries and terrible performance), life is easier and better all round if the users upgrade their foundations once in a while.
> BSD comes up and say this is not portable
systemd doesn't care about the kernel per se, only which features it provides. If they want to provide a cgroups-like API (which they should, because it's a great idea in and of itself), then I expect systemd will be ported to it fairly quickly.
It's different but I wouldn't call it more or less complicated than sysvinit. There are a lot of example/skeleton files floating around, especially archlinux's collection is useful.
Of course, systemd allows for much more configuration than simple running of scripts on boot, but you can fine tune later.
http://www.freedesktop.org/wiki/Software/systemd/Incompatibi...
Now the non-portability of systemd is seen as a reason for Debian to drop the ports.
The only downer is that now there'd be 2 init setups/configs to maintain. But that would be the case even if systemd were not the default, just available as a choice.
For OpenRC, there is just one person advocating it. There is a summer of code thing, but seems not much work is done. Furthermore, OpenRC seems nice, but parallel starting of services is actually experimental/buggy (just ask one of the OpenRC maintainers!). So although you can have a similar boottime, one init system (systemd) will be running in a supported configuration, the other (OpenRC) in something that is known to have issues.
That all said, I don't think Debian really makes decisions. What is being proposed is maintaining two.
Aside from above, there is also the practical bit in that systemd provides something to replace the unmaintained and deprecated ConsoleKit with. This bit can be used on another init system (Canonical is using or will use it on Upstart), but at one point seems easier to rely on the existing systemd supporters in Debian to get things working correctly.
So I hope I won't be forced, to a more crappy system !
The fact that it will be handling a lot of stuff more, sounds like a major pita ...
| the pulseaudio stuff didn't go smooth
That wasn't the fault of the developer so much as it was the fault of the distributions for jumping on the bandwagon (making it the default audio system) too early.At one point I was also able to stream audio from my HTPC to my laptop, so that I could use my headphones when everyone else was sleeping. Though I'll admit configuration was a pain in the ass, I don't recall being able to do that with ALSA (though I recall someone creating a shell script a while back that read from /dev/dsp and piped to a socket).
Prior to PulseAudio, sound on Linux was always an uphill battle for me (don't get me started on regressions in the PowerBook audio driver that no one cared about since "it works on the newer PowerMacs"). It was a crap-shoot which audio system an application would use. OSS? Alsa? eSound? KDE's sound daemon? Do they all use the same mixer app? What happens when I write to /dev/dsp? Does all other audio block? Which applications support Jackd? etc...
[1] Referring to the mic in the pulseaudio context.
EDIT:
> I literally know no other linux users who
> have ever had anything good to say about
> PulseAudio.
I'll mention that the same could be said of OSS or ALSA too. They may have worked better for you, but I doubt that prior to PulseAudio, you were singing their praises from the rooftops.The movement out of shell-based initscripts for non-specialized (non-mobile/embedded) distributions is a cancer.) Remaining BSD guys are much more sane and "conservative" in this respect.
There is absolutely no necessity to break what is good-enough and well-balanced - having a standard shell scripts to do the job they were designed to. FreeBSD's rc.d system is a very good example.
That is what I see as the main message from your post. If you wonder why people move to something else and your ideas are ignored: try coming up with real arguments ("X is better" is a bit light on details!) and ignore the need to rant about abusrd, cancer, etc.
Besides that, yes, it does have a few things (hostnamed, timedated), which are mostly about some POSIX infrastructure that wasn't there already: notification when the system hostname or timedate changes (yes, it happens quite often on desktop systems, due to NTP, user setting, and VPN). They're just utilities they needed along the way, and systemd can be built without them.
If the system or service fails to start, instead of hunting around in /var/log/, syslog, dmesg, etc. for anything that looks relevant, you simply use the journal which aggregates most everything. It's already a very good breakthrough.
I've debugged countless bad Debian service scripts (which usually comes down to bash's terrible whitespace and quote management), and inserted echo statements into my Arch Linux to debug why it wouldn't boot when I upgraded, hacking out clear statements here and there designed to make the boot pretty. Shell scripts aren't a good solution for robust system and service management.
That other operating system from which the concept of a "service" came from (along with lots of other crap) have different philosophy and founded on different design decisions, so blindly trying to bring stuff from it here is not always reasonable.
And, of course, shell scripts are OK when well-written - there are other UNIX-like systems beside Linux.)
A systemd "service" is just a declarative description of a daemon that allows systemd to start and stop it.
I'm curious if faking cgroups (or heck, porting it) would be an easy solution.
Not talking about a fake cgroups providing all the real world advantages of systemd; merely a a fake not being too much worse than existing sysvinit.
Maybe rephrased actually porting THE cgroups to HURD might be impossible due to design issues or license issues. OK well how about writing a stub cgroups using the API that always gives a pleasant and completely meaningless response to all calls. What, if anything, would be the overall system wide net negative effect of systemd on HURD with a fake cgroups? I have not had much success googling for that.
This would not fix the "my /usr is not on my / partition" problem which is a serious concern to a extremely small number of people.
systemd uses cgroups to tag processes with metadata about services, and to provide resource limits. If you added a stub cgroups, then resource limits wouldn't apply, and you might run into issues with services not fully shutting down as you do right now with the POSIX service management.
It's entirely possible, but you wouldn't get any of the upsides of systemd.
1) /usr split
2) Can't run on kfreebsd and hurd because they don't speak cgroups so either "we" can't run systemd or need to drop ports or need to support two init forever.
You can eliminate #1 with some sysadmin work. A stub cgroups compatible API emulator type thing for kfreebsd and hurd would eliminate complaint #2 if the overall result were not much worse than existing sysvinit.
One interesting solution is there is no particular reason to flick the power switch on kfreebsd over and over as quickly as possible. So one incredibly non-optimized way to "fake" cgroups process monitoring on kfreebsd would be to replace actual cgroup process monitoring with something ridiculous like "sleep 30". In 30 seconds, anything will have started or stopped, correct?
Obviously a dev roadmap would be to replace/emulate/port real cgroup-like support, once people get tired of all cgroups api calls being replaced with "sleep 30".
I can't be the first one to come up with this "great" idea.
I also want to note that cgroups is not the only Linux-specific interface that's necessary for systemd. There's lots of them, and if you stub all of them out, then you've achieved portability with none of the benefits, and have potentially introduced a lot of bugs. You simply make systemd runnable, but unusable.
I think you have the wrong impression of cgroups entirely, though. It does not do "process monitoring". Think of it more like a hierarchical processes tree. With a traditional hierarchical filesystem, to recursively delete everything in a folder, you use a combination of readdir and unlink. In cgroups, it's similar: you put processes in a "cgroup", and to kill everything inside a "cgroup", you iterate over everything and call kill.
And much like in some filesystems you can say "make sure this subtree doesn't go above 1GB of storage", you can apply similar resource limits to cgroups: "make sure this subtree doesn't go over 2GB of memory and 25% CPU time", etc.
A stub interface that doesn't iterate over any of the processes won't really do you much, and thus when you try to stop a service, it won't get shut down.
This has been clarified a great number of times, also by Lennart. If you're against systemd because of /usr, you're not against systemd :D
Since systemd is written in C, the canonical way to write portable code is by using conditional compilation, for example with ifdef statements. That makes the code harder to understand and reason about, but more importantly it blows up the test matrix."
Take a page from NetBSDs effort... http://www.netbsd.org/about/portability.html
How will this work? In the short-term future, maintainers add systemd support to their packages. This does not imply dropping sysvinit support. As outlined in my post about the transition, systemd service files can coexist with sysvinit scripts. In the mid-term future, both sysvinit and systemd are supported — this is the only way we can do a gradual transition, and Debian clearly does not want a flag day. In the long term, we could switch the default from sysvinit to systemd on Debian GNU/Linux, in case we agree that’s a reasonable decision at that time. Non-Linux ports will still use sysvinit.
We can argue over the exact meaning of "switch to" (seems pretty pointless to me), but it seems fairly clear that in the near future nearly all debian users will be using systemd.
This is a blog post by a Debian developer that would like the project to switch the default init system. It includes some discussion of how Debian could make the transition. It's nothing the project has committed to, so saying "that in the near future nearly all debian users will be using systemd" is unwarranted.