Skip to content

"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?

33 points77 comments
Open on Reddit
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:

  • UNIX philosophy is a guideline. Something isn't bad just because, "it doesn't follow the UNIX philosophy". This is not a religion, so there is no dogmatic law.
  • The same holds for the Arch Way.
  • The Arch Way also tells us that we should do things that are "simple" for the developers. Instead of duplicating efforts and maintaining or own (broken) init system, we now use one that is used by many, gets more attention and more bugfixes. It is also a more modern system that makes solving many problems much easier for us. Of course, the Arch way might be interpreted differenty - but as I said, it is no dogma, it is a guideline.
29 points

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.

11 points

Arch might as well just be another Debian

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.

13 points

This is silly, the Arch Way is about long term technical simplicity, not short term ease of maintainence for the developers.

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.

6 points

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).

4 points
unknown author3 hidden

The Arch Way also tells us that we should do things that are "simple" for the developers.

Then arch linux should become rolling-release fedora linux.

-2 points

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.

1 points

maintaining or own (broken) init system

It is not broken, it just works since 20 years. Maybe it is ugly. But not as ugly as systemd.

-5 points

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.

6 points
  • cron: systemd does not have a complete cron implementation as far as I am aware. It supports running services periodically, but AFAIK is not as flexible as a full cron daemon. Anyway, I understand why they might add more cron features: It's part of systemd's "PID 1 manages your services" philosophy, as it considers a task that runs periodically a system service. Then again, you are free to keep using your own cron daemon.
  • acpid: To be honest, acpid does virtually nothing at all. It reacts to some acpi events and runs a script. Again, "PID 1 manages your services" - and starting/stopping a service upon ACPI event is part of that. And as above, I think you can keep using acpid, if you want another process in your system that sits there doing nothing most of the time (I haven't tried that one - but seriously, acpid really does nothing at all).
  • xinetd: You ask about this because you do not know a thing about systemd. The whole idea of systemd is that you start a service when it is needed, not when you start your system. This is mostly done by socket activation: Instead of launching a service, systemd can listen on its listening unix socket, tcp port, udp port or whatever, and once someone accesses that, systemd launches the services and passes the connection. This is the key reason why systemd is superior to the other init systems. What xinetd does is a very small subset of that functionality, and thus systemd clearly obsoletes it.

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.

18 points
unknown author11 hidden

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?

1 points

Can you elaborate more about the "socket connection activates service" principle besides the xinetd aspect here?

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.comm and 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.

What are the benifits?

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).

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?

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).

8 points

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?

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.

4 points

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.

3 points

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:

One central feature of systemd is D-Bus and socket activation, this causes services to be started when they are first accessed, and is generally a good thing. However, if you know that a service (like ConsoleKit) will always be started during boot, then the overall boot time might be reduced by starting it as early as possible. This can be achieved (if the service file is set up for it, which in most cases it is) by issuing:

systemctl enable console-kit-daemon.service

2 points

This is the aspect of systemd that many people do not like. For an init system it is getting very bloated.

13 points

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.

74 points

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.

21 points
unknown author1 hidden

Thanks for clearing this up. Feel much better going with systemd now.

13 points

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.

-11 points

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.

6 points

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.

3 points
unknown author2 hidden

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.

2 points

Also, depending on how systemd is architectured, things might be pretty modular.

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".

-3 points

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.

8 points

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.

4 points
unknown author

Deleted before we saved it.

1 points
  1. You ought to link the wiki page with that line in your post.

  2. 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.

-4 points
unknown author1 hidden

Deleted before we saved it.

10 points

"It was easy for me to set up and it booted faster, so it must be better"

Well that's a pretty good correlation at least, right?

1 points

way to be all condescending.

seems like a legit question to me.

10 points

It seems that "bleeding edge" is prevailing over "KISS" within the Arch Philosophy.

-6 points

I don't know. It seems that using systemd is simpler than maintaining their own, incompatible init scripts.

13 points

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.

10 points

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?

3 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.