"Do not worry about systemd's plans to replace the functionality of cron, acpid, or xinetd." - Arch Wiki?
I was reading about systemd, and I don't quite understand this. Doesn't this go against the arch way/unix philosophy? Why is systemd doing this? Why would Arch switch to something they know plans to go against the arch way in the future? All of the articles I've seen admit a lack of knowledge about init systems, what do the people who know about them think?
About this post
- Posted
- Archived
- Score
- 33 · 100% up
- Kind
- Text
- ID
- 1001aa
84 comments
I didn't want the discussion about my first reply contaminated with this topic, so I'll put it in a separate one:
EDIT (at the top for visibility): It seems people haven't actually read/understood my post. My criticism is of the significant misunderstanding of the Arch Way, and defeatist mentality that advocates using only the most common software instead of making the effort to do better. I'm not saying systemd is good or bad, I'm saying any replacement should not be hailed as a good thing if it is brought in just because developers lack the manpower to do what they really wanted to do (what is technically simple rather than just what is most common/supported best).
This is silly, the Arch Way is about long term technical simplicity, not short term ease of maintainence for the developers. Going by your idea of "simple", Arch might as well just be another Debian derivative because that is simpler for the developers as they have to do a lot less work maintaining their own unique system.
There is a difference between taking the time and effort to write and maintain a 5,000 SLOC program to replace a 100,000 SLOC program for the sake of simplicity, and just not bothering and accepting the 100,000 SLOC program. The Arch Way is not about giving up and piggybacking on the work of others.
Not at all, because Debian will strive to support all init systems, while Arch will support only one, the one that was deemed the best by the arch devs.
And by using
systemd, many things will get simpler for us short-term and long-term. And by "us", I mean everyone: The Arch developer, the sysadmin and the end user. Customizing your system is simpler. Implementing new features is simpler. Integrating services properly with each other is simpler.I still urge you to read Lennart's original two-year old blog post to understand why it is designed the way it is. After you've done that, please come back and tell me why using systemd is wrong.
As the initscripts maintainer and a systemd proponent, I'd like to state (yet again) that I'm not in favor of systemd (purely) out of laziness. I think it really is better and simpler and more robust in the long run and no amount of manpower would make any of the competitors competitive (unless they were rewritten from scratch to incorporate several of systemds features/principles).
Then arch linux should become rolling-release fedora linux.
Rolling release Fedora is Rawhide.
How does that even follow? Was that supposed to be a two-pronged attack against both Fedora and Arch? Pretty weak, especially considering Fedora and Arch both strive to be as close to upstream as possible.
It is not broken, it just works since 20 years. Maybe it is ugly. But not as ugly as systemd.
Arch only exists for little more than 10 years, so it clearly cannot have worked for 20 years.
Beauty is in the eye of the beholder, my friend. I think systemd's architecture is a complete breath of fresh air compared to sysv.
All your questions would have been answered if you had read the original systemd post. Yes, it is very long, but it clearly explains what an init system should be doing and why systemd does the things it does.
Can you elaborate more about the "socket connection activates service" principle besides the xinetd aspect here? What are the benifits? If, for example, I have a bunch of network services, why would I want to delay the activation of these services if they will be activated at some point anyway?
I'll give you an example. I have an OpenPGP smartcard that I sometimes use with gnupg. To use it, I need pcscd running. I need to use that smartcard once every month or so. With the old initscripts, I always had pcscd running, even though I almost never needed it. Now, systemd creates the unix socket
/run/pcscd/pcscd.command waits for a connection. Only when gnupg (or anything else) connects to that socket, systemd will start pcscd and pass the socket to it.This works transparently for the applications.
BTW, this has always worked with dbus and bus-activated services.
You run the daemons you need, when you need them. You don't run the ones you don't need.
If you actually read Lennart's blog post (which I linked above for your convenience), you will also notice another advantage: You need less explicit dependencies in units. systemd opens all sockets first and then starts the daemons. With a traditional init system, many services will fail because necessary sockets are missing and you need explicit ordering. With systemd, all sockets and port will be present and open, and everything will just work without any explicit ordering - this means that you can do more startup in parallel. Read the blog post, Lennart explains it much better than I ever could ("Parallelizing Socket Services" in his post).
It depends. Even if you are sure that the services will be needed, it might still be useful to a) optimize and simplify your startup, and b) reduce the time they are unvailable during a reboot (when someone connects to a service when it hasn't been started yet, instead of "connection refused", he will get a short delay and everything will work, and he won't even notice your system was still booting while he connected).
So you can start the rest of your system up faster.
And then when your system has started up, the sockets for those services will already be open, and will have cached some data for your services to read, courtesy of systemd. So they can take the cached data and start responding merrily on their way.
So your system as a whole is able to boot, and respond to input, in a faster and smoother manner.
If the phrase "minimal downtime" means anything to you, then systemd should be a welcoming sight.
There are many benefits to socket activation (most of which have been outlined by others already). IMHO the most important feature is that instead of having to explicitly order services one after the other (and then suffering from race-conditions when you forget some dependency), you can just: start all sockets first, then start all daemons. As the sockets are created before the daemons no ordering information is needed in the daemons at all. This should make writing .service files much simpler and more robust.
Then there is also the optimizations (starting things earlier, or starting fewer things), but that is secondary IMO.
Socket activation, if I understand correctly, is an optimization.
With this systemd doesn't have to start everything at once, and the user doesn't have to enable everything explicitly (which is also why systemd has dependencies on services)
However, you don't have to use it, and you can start a service you know is going to start anyway as soon as possible too.
From the wiki:
systemctl enable console-kit-daemon.service
This is the aspect of systemd that many people do not like. For an init system it is getting very bloated.
that's because they do not understand the full implications of the unix way - "Write programs that do one thing and do it well".
what systemd does is - start/stop the system and its services.
acpid is basically doubling for init system, when it comes to acpi events. it can start/stop services or change init states based on acpi events.
xinetd can do the same, based on network events.
cron is basically the same thing, based on time events.
monit is a tool that restarts services when they fail. systemd can do that.
since systemd is heavily event based (device derived services, mount services, fsck services, etc), it can be naturally extended to cover all of this. in case of xinetd it's damn obvious (especially since there is socket activation already implemented), in other cases - a bit less.
it just takes some thinking about it and it makes sense. only one tool should manage starting/stopping services and starting/shutting down the system, not ~4 (or more) of them running alongside on the same system.
I think this is the best description I read so far.
Thanks for clearing this up. Feel much better going with systemd now.
Deleted before we saved it.
Moving my mouse is totally event based. Maybe systemd should handle this as well and tell programs about mouse movements via dbus.
And while we're at it we should let ConsoleKit take extra care about file permissions with a specialized API just to be sure, because redundancy always doubles the greatness, also file access is totally event based.
Also the Pulseaudio API is way to complicated and it sometimes crashes. We should introduce a new abstraction layer called PulseKit to handle audio more smoothly.
It is pretty much set into stone that in the future we need to launch a full blown Gnome sessions inside the init system because otherwise we can not use many of the new great optimisation features of systemd. Also in the future everybody will use Gnome on Fedora anyway. There will be nothing else ever.
It also has the potential of making things much faster. One optimized C executable will be much faster than a thousand shell scripts. Also, depending on how systemd is architectured, things might be pretty modular.
In the end everyone complains that systemd is "bloated", but the linux kernel is a monolithic kernel with more than 15 million LOC and I don't see anyone complaining.
Hello, 911? I need to report a severe burn.
When I switched to systemd on my laptop, I did not observe any improvements in boot time. Laptop has SSD. The idea of compiled C binary handling init is not bad but currently I have a problem when X starts - it fails with an error 'Fatal: no screens found'. It looks like a race condition and I don't really know where to begin debugging this as the systemd already does many different things. As I've said previously, initscripts are bad but the systemd is the wrong solution.
Right now they are not, systemd is the opposite of modular. It is also not really optimized. The worst thing is that vital things that do not belong together are thrown together solely for political reasons (mainly to force shit down peoples throat).
Technically you could separate all tools into single replaceable entities without sacrificing any performance. But what should you expect from someone who says that the unix philosophy "is holding back innovation".
It's an odd statement to make in the wiki (I was not aware of it until now).
For those who are not aware, the situation is:
systemd has or will have features that makes syslog/xinetd/acpid/crond redundant (for many/most use-cases, but not all). To see why integrating this functionality into systemd makes more sense than keeping them separate one would have to study the cases in some detail. The important thing to notice is that systemd would not get in the way of the existing daemons continuing to be used if that's what you prefer, so in this sense "don't worry" is sound advice.
To answer (albeit superficially) the question of "why?":
Take crond and xinetd, these are two special cases of ways of triggering daemons/scripts to be started. The astute reader will notice that that's exactly what systemd is for. Moreover, it turns out that systemd needs both these sorts of mechanisms: it needs to be able to trigger on timer events (which is essentially what crond does) so that it can do things like "every day run the tmpfiles service" or "stop collecting readehead data 20 seconds after boot finished"; and it needs to be able to trigger on socket activation (which is a generalisation of what xinetd does) in order to, well, do socket activation (which there are plenty of sources on, but it essentially allows us to not have to specify lots of dependencies between daemons).
The point is that the functionality that systemd needs in order to operate, is not too far from the functionality needed in order to emulate all these legacy daemons. Making this optimization (a few lines of code in systemd in order to be able to drop several daemons) seems like an obvious thing to do. Especially from the point of view of KISS.
You can already use systemd to replace cron (timer units, definitely not a full replacement yet, but you can use it if you only need a few simple jobs) and acpid (systemd-logind). But they are optional, you are still totally free to use cronie and acpid.
Deleted before we saved it.
You ought to link the wiki page with that line in your post.
Since you obviously haven't been paying attention to any part of the Arch community at all ever, there are plenty of threads about all aspects of systemd, to include support, criticism, fanboyism, and batshit insanity. Look at the mailing list archives of arch-general and the forums, especially, in addition to the two fairly large systemd threads still on the front page of /r/archlinux and the further large threads further back.
Deleted before we saved it.
Well that's a pretty good correlation at least, right?
way to be all condescending.
seems like a legit question to me.
It seems that "bleeding edge" is prevailing over "KISS" within the Arch Philosophy.
I don't know. It seems that using systemd is simpler than maintaining their own, incompatible init scripts.
i'd take systemd over init scripts any day.
at least it doesn't lie to me when i check given service's status. or it doesn't type out " OK " when the service actually fails to start.
The difference here is accessibility. If one of the initscripts does that, you can open it up with a text editor, fix it yourself and test it on the spot, then tell someone about it or submit a patch. It's easy and anyone could do it.
For a big C program like systemd, you'll have to set up a build environment, get the source, edit it, compile it, make a package and install it (on your test box of course, since you might make your main PC unbootable by hacking on init...) See my point?