Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

S6 can format your hard drive and you still will think that it's "high quality".

So can systemd. Additionally, the number of unresolved bugs with systemd grows incessantly over time, still without any sign of leveling off (let alone sustainably decreasing). In comparison, with s6/s6-rc and related packages, the fix for any bug (there have been very few) almost always arrives within one week of the bug report, and even if we also count other projects with functionalities emulated by systemd, the number of bugs still does not grow in systemd’s fashion.

It's quite clear that you are resistant to facts and basically venerate crap code only because it's not systemd.

It's quite clear that you are resistant to facts and basically venerate crap code only because it's systemd.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

Nope, show me a full SysV compatible script that runs Apache with S6 utilities.

You mean chainloaders have to be aware of some init/rc system in order to be init-agnostic? Nice self-contradiction. As long as the chainloaders do not require a particular init/rc (instead of the other way around), they are init-agnostic, just like sed and grep.

Doesn't matter. This code is crap.

Which is vastly less harmful than the crap throughout systemd.

Been there, done that. I ran systemd with my implementation of journald that submitted data to our logger through high-speed hypervisor interface. Worked like a treat. We also have custom implementations of many systemd units.

Which is irrelevant. How much effort did it take elogind developers to separate logind from systemd? How much do I need in order to extract the nosh utils?

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

Nope. systemd is immune to these kinds of issues, cgroups are controlled in the core and it can't crash due to OOM or resource starvation (since PID1 is special).

Most daemontools-ish init/rc systems are also immune, because their supervisors are tiny in comparison with the memory hogs.

So is systemd. Critical parts of it are barely 10k SLOC and have been audited well.

Really? Then how did problems like this and this come into existence?

Which they were not. Any sane reviewer would have vetoed code that has gotos back into inner blocks.

The particular goto in move-to-control-group is ugly (and therefore surely needs rewrite), but works correctly. Not a bug like the two above.

You have unavoidable race conditions with wrapper scripts dying before they can update the state in some third-party registration system. And this third-party system becomes a critical component that has to be treated as PID1. At which point any sane person would ask "why not put it in PID1 then?".

The chainloaders will do their work before exec(), so no race conditions.

Because it can. Other types of resource exhaustion are also possible, like nr_files. systemd is utterly reliably in this case and any competing manager will have to be just as good. You're not writing software that works only in the "happy case" when nothing goes wrong?

Not a problem, because the supervisors open few files. Care to give a valid example?

Nope. systemd is quite evidently easier to extend and customize. It's trivially easy to replace pretty much all of its components. You can't do that with S6, it expects only a very particular set of wrapper scripts that behave in very particular way.

Did I not say chainloaders are init-agnostic and many of them are written in C/C++? You memory condition is worrying.

Sure. And by the time you do it CORRECTLY, closing all the loopholes and race conditions, you will get systemd.

As I said above, it should be called "systemd done right". Because of high cohesion and low coupling.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

Try that with Apache.

You mean Apache cannot be used with setuidgid?

Nope. All of the code in nosh is crap. Like convert-fstab-services.cpp. And it's crap according to common definitions - cyclomatic complexity and other commonly recognized bad code practices. For example, "create_geli_bundle" function takes 13 arguments (and it's NOT an outlier).

Which does not reside in the memory, either, after the conversion is done. Also, I can build nosh, extract the cgroups utils, and then use them with the better written s6/s6-rc. Try that with systemd.

You are not getting it. Double forking is not "required". It's what real-life programs do, including closed-source systems that can't be modified. Moreover, even well-behaved daemons can accidentally (or as a result of an attack) do what amounts to double-forking. You can't wave it away.

As I said,

This can be solved using cgroups-polling daemons in addition to cgroups-handling chainloaders. Not trivial, but still cleaner than systemd. The reason it is not yet done is because handling double-forking escapes has not become a hard requirement for enough people.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

No, you can't be. Any chainloader can contain a bug that does "rm -Rf". Or it can simply hang indefinitely, leaving PID1 without any information about its state.

All these problems can also happen with systemd. Chainloaders are independent programs with few SLOCs, and can be easily audited to be at least free of obvious bugs, again unlike systemd. So systemd is strictly and obviously weaker than daemontools-ish init/rc systems in this aspect.

And since PID1 in S6 does not manage cgroups, it can't reconstruct the state of the system. This introduces a whole new class of bugs that simply can not exist in systemd.

All unconstrained root-owned processes can manipulate /sys/fs/cgroup, so what can PID 1 do about cgroups that other root-owned processes, for example a s6-supervised manager for cgroups, cannot?

And they are not even hard to trigger in S6. For example, it won't be able to detect the OOM killer reliably. It's entirely possible for it to lose track of services if the OOM killer happens to kill a newly launched supervisor at an inopportunate moment.

Why would the OOM killer kill the supervisors if they are designed to be as small as possible?

So? They are just binaries that have the source code that lives in the same repo as systemd. That's exactly what "modularity" is.

So the coupling of the init component makes it much less debuggable/maintainable/customisable than its daemontools-ish counterparts.

As I demonstrated, double-forking escapes can happen accidentally. And s6-fghack does NOTHING to deal with it. At all.

This can be solved using cgroups-polling daemons in addition to cgroups-handling chainloaders. Not trivial, but still cleaner than systemd. The reason it is not yet done is because handling double-forking escapes has not become a hard requirement for enough people.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

No, they are not init-agnostic. They can't be used with SysV init, for example. You'll need a wrapper script that would adapt them to SysV conventions.

Oh I see, no wonder the following code cannot be written in an init script for sysvinit:
FETCHMAILHOME="/home/fetchmail" chpst -u fetchmail fetchmail -v --nodetach --daemon 551

I actually did. Quite a few of them are linked into nosh itself ("modularty-shmodularity"), like "move-to-control-group". It's also a TOTAL CRAP code. Yes, with caps. Example right here: https://gist.github.com/Cybera... - a goto jump back into the body of an "if" statement. Mixed with incoherent error handling - the body of an error is printed to stderr with an additional C++ exception.

So one of nosh chainloader perhaps roughly as bad as some crap in systemd. Except that the code no longer resides in the memory or interacts with the init system after move-to-control-group chainloads into the next program, unlike the crap in systemd.

The first versions of systemd actually had the core just right - RELIABLE service monitoring with full SysV compatibility. S6 has neither.

"Reliable service monitoring" and "Full SysV compatibility" requires crufts like double-forking and sysv-rc, which is by design not supported by daemontools, runit and s6.

Except it doesn't work. And never mind that many daemons actually do close all descriptors before double-forking. Learn some Unix, noob: https://codingfreak.blogspot.c...

As long as most daemons support foregrounding, and few (less and less) of the remaining ones do it this way, not a big deal.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

No, it does not make it easier to "reason" about. In systemd you have a function that scans the cgroup and gives you a "true" result if it's empty. Replacing it with an external utility does nothing at all to make it easier to reason about.

With daemontools-like init/rc systems I can be perfectly sure the code in the chainloaders will not affect the init system, so entire classes of bugs are very unlikely to occur. Did you ever learn cohesion and coupling? If systemd had high cohesion and low coupling, how could stupid bugs like this come into existence?

Sure. Let's do it! sloccount on nosh results in 79,712 total lines of code. Not all of it is crucial, but I'm lazy. And anyway, it's not all! We also need at least dash, because nosh needs shell to function, that's at least 13,365 LOC. And then you'll also need some shell utilities. I'm too lazy to look into them right now. Let's put it at 100kLOC.

Again, you did not even skim through the documentation. nosh has its run script interpreter, "nosh", and a full set of chainloaders. No need for the shell for routine use, just like systemd; much better self-contained, unlike systemd.

Now let's look at systemd. It's self-contained and only needs glibc to function, it's possible to boot a working system without a shell. You need the following projects: libsystemd (35,733), journal (19,184), core (52,190). The total is 107107 LOC, and that's including unit tests (too lazy...). And that's it. It's self-contained and reliable, with the core size about the same as in "lightweight" systems. Everything else in systemd is contained in modular helper processes, that can be ignored or replaced at will with something else.

Except that all mainstream distributions also ship most "optional" systemd modules, with a lot of "optional" dependencies, and its architecture in this case is not much more "modular" than this.

A daemon can double-fork and escape from the supervision of the init system. S6 would require all daemons to be rewritten to work with it. Meanwhile, systemd can reliably work with unmodified double-forking services.

As I said, few daemons now mandate double-forking, and we also have s6-fghack.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

No, they can not. They will encode the assumptions of the underlying init system.

You did not even skim through the documentation of the chainloaders, for example s6-setgiduid and create-control-group, or you will notice how they are init-agnostic. As was said here,

Many of the run scripts are interchangeable across toolsets. Don't be fooled by the use of execlineb, s6-xyz tools, and nosh package tools, for each package. One can quite happily use execlineb or s6-xyz tools in a run script with the nosh package, or vice versa for that matter. One could use chpst under perp, or runtool under daemontools-encore. The fact that daemontools, daemontools-encore, freedt, and runit are mostly all in one column should be taken as the stronger indicator here; there's no strict lock-in of run scripts to any toolset.

Now you're completely incoherent. If your magic wrapper script has a root bug (and let's be honest, shell scripts will be choke-full of them) then this script will have to be fixed, just as systemd had to be fixed.

First, most of the chainloaders are written in C/C++, in much clearer ways than that in systemd. Second, you surely did not even realise how simple the run scripts are when you said they would be choke-full of bugs. Third, with chainloading I can be sure changes are limited to the 100 or so lines of code in a single chainloader. Vastly better than systemd.

Since they are not used in real world, of course they do not work better.

So because systemd was not used in "real world" in its early years, it worked worse than sysvinit? And they are certainly used in real world. Check their mailing lists.

In particular, S6 can't work with unmodified daemons that do double-forking. It can be retrofitted with cgroups, but then you'll have an unholy mess of processes - each daemon will have its own overseer process which simply polls a cgroup. If an overseer process is killed by mistake, the daemon process it controls will be an untethered zombie.

Since most of them support foregrounding now, this does not seem to be a big deal. We also have s6-fghack for double-forking daemons, much simpler than using cgroups.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

cgroups are crucial to the functionality of systemd. In particular, they are also used to detect the daemon death (when no processes are left alive). Sure, you can use external utilities to do that, but they are going to be critical parts of the system.

Exactly, and refactoring the critical parts as multiple loosely coupled components (init, chainloaders, etc) makes the implementation easier to reason about, and therefore easier to debug/maintain/customise.

Moreover, cgroups manipulation takes comparatively few lines of code in systemd. Interaction with external wrapper scripts will necessarily take more.

Wow, interesting. Care to compare SLOC of cgroups code in systemd and nosh?

What's even worse, it's going to be unreliable. If a wrapper script misbehaves or dies (because of an errant SIGKILL, for example) then the system will be left in an indeterminate state. PID1 won't know which cgroups need to be cleaned up. Just as a reminder, PID1 is uniquely protected against SIGKILLs in Unix.

Chainloaders work by exec(), so they are direct children of the init system, which will certainly know when they die. You need to learn some Unix.

It's pretty clear that none of "veteran" developers actually thought about reliability. But this is no wonder, they know nothing about modern system design.

"The price of reliability is the pursuit of the utmost simplicity." No wonder those who make "modern" systems never understand reliability.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

I don't see how it makes integration trivial. The way to do it is for the init system to set up cgroups and then launch the daemon there. You can even do that with SysV init. If you have to use wrapper scripts ("chainloading") then perhaps you should change your system.

Because wrappers can be written once and then used in every init system, and can be easily replaced with healthy workalikes in case this kind of bug occured. New wrappers can be plugged into the system when new requirements appear, unlike systemd which has to be upgraded as a whole, bringing about all potential problems with new code in other systemd components.

And nope, it has nothing to do with service definition as you still need to at least encode dependencies.

Which is why systems like s6-rc and anopa exist. Decoupled from the init system. Unlike systemd, and yet work much better.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

1. To keep track of the process tree - classic Unix does not have any means to keep track of children launched by the daemon process. 2. To keep track of resources and impose resource limits, such as CPU fairness, memory use or disk IO bandwidth.

Classic Unix does not have a reliable way to track process' children to be able to reliably kill an unresponsive or (intentionally) misbehaving daemon. DJB's daemontools tried to use process groups for that, but quite a few services launch child processes in the their own groups.

... none of which justify supporting cgroups inside the init system, because support for cgroups can be easily done with chainloading commands.

You are an idiot. Yes, you ARE an idiot.

Stop talking to the mirror.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

You certainly can. Feel free to write a script generator that translates unit files into init scripts. The fact is, before systemd nobody was actually doing that. And somehow Devuan developers and other crazies haven't managed to do that in the last 10 years.

You are surely blind to programs like convert-systemd-units.

Comment Re:systemd's advantages are not unique to systemd (Score 1) 212

"Bernstein chainloading" - nope. It's not a replacement for cgroups and you're an idiot if you suggest this. Neither does it have any relation to service definition.

I did not say Bernstein chainloading was a replacement for cgroups. It just makes cgroup integration trivial to do in all init systems, whether it is daemontools, s6 or even sysvinit. And it is surely very related to service definition. Your understanding of Unix is lacking.

TLDR; version is - nobody has yet produced an init system that is even remotely competitive with systemd. Do this and then we can discuss if it's better.

TL;DR: Those who do not need systemd's "advanced features" can use sysvinit. Those who do can use s6/s6-rc. I see zero reason to use systemd.

Slashdot Top Deals

I've noticed several design suggestions in your code.

Working...