Hacker News new | ask | show | jobs
by Mave83 837 days ago
SystemD took away the pain. You no longer have to think and reinvent the demonize, logging and so on. Just just start what ever you want in a while(1) loop and write to stdout and stderr. No log rotate nightmare, etc.

This makes daemons easier to debug, as they run just in foreground so that you can start them from the cli to thinker with them.

SystemD is highly discussed and some love and some hate it. But such improvements are unmatched and extremely helpful.

1 comments

OpenRC, daemontools, and many other service managers provide daemonizing wrappers, and all substantially predate systemd.

The Systemd Cabal are far from the first to have noticed and attempted to resolve most of the problems they tackled... they do have the most effective "developer relations" team of all of the projects in this space, though.

(I do continue to love their old "It's so much better than System V Init!" talking point... as well as their "You'll never have to write a shell script to start or manage a service again! Declarative, INI-formatted Unit Files For Everyone!" one.)

The systemd cabal one-upped all other efforts that pre-dated them by leveraging cgroups such that what rlimits your services run with is dictated by the unit file alone, and not by whatever your user session had when you issued the start or restart command.
And they did so by sweeping the entire UNIX landscape into the dustbin, only supporting linux, and in return giving us a management system that can't be sure anything is running[1].

systemd is leaps and bounds better than most of the init systems that came before it, but it's not a good daemon supervisor, and the developers have basically declared that it's "good enough" so improvements are unwelcome.

1 - http://ewontfix.com/15/

What link is a bit weird. https://www.freedesktop.org/software/systemd/man/latest/sd_n... documents exactly what is sent and how. You can implement that function yourself very easily. Their edge cases are solved by opening the notification socket before you chroot. Writing to a socket would be just as systemd-specific as the current solution if that's what systemd would expect.
Also, do you happen to know how, say, macOS manages service dependencies with launchd and makes sure everything is running?

It doesn’t.

It explicitly says in the scarce documentation that it doesn’t care, and that interdependent services should use IPC and in general figure it out between themselves. launchd only launches the processes as soon as it can, and restarts them based on a boolean flag if they die. That’s all.

systemd at least gives you something to base your expectations on.

Adding a mechanism for dependencies which kind of sometimes sort of works but doesn't actually work is much much worse than just not implementing anything at all as you are much less likely to get anyone too put in the work required to do the hard thing they need to do for it to actually work.
It does work: an init system shouldn’t have a knowledge of what constitutes a process being "ready", but it knows damn well if its executable is running or not.

Any dependent/client task should be able to wait or retry. If it cannot retry on its own, systemd has a facility for this, too.

At this point it really looks like after having some nice things you are running out of legitimate complaints and want a pony on top.

Well, do systems like, say, FreeBSD even support facilities functionally equivalent to control groups? Even if they do (which they don’t), it would be a whole new separate implementation, and there’s not enough interest from anyone who can do it to roll their sleeves and work on it.
FreeBSD, specifically, has had jails and Capsicum longer than systemd has existed, and rctl (aka Resource Limits) for about a decade now.

Like I said, systemd is a great init system but it really did not bring anything to the table as far as service management. Apple's abdication of the problem makes sense since they're tightly focused on workstation ever since killing the Xserve line in 2011.

Can rctl give me an ability to run two instances of the same executable with different limits?
Answer to question - yes, and more. Jails+rctl (available since 2012) is not cgroups it's cgroups+SELinux+APParmor. Vanilla linux container is not a security barrier, vanilla FreeBSD jail is.

In practice this means more seamless 'isolation' in Linux case but that isolation is weak. Which perfectly corresponds to FreeBSD looking at server uses 99% of the time and Linux looking at the desktop too.

About your conclusion, I don't think that's based on anything so please do write on what facts do you base the assessment that FreeBSD has no resource limiting and isolation features, and that it would be a 'separate implementation', as FreeBSD always tends to upgrade and not change tools and interfaces, and that there is not enough interest from anyone to implement it, as most major FreeBSD features are actually paid for by FreeBSD sponsors.

I don’t assess FreeBSD doesn’t have resource limits. I’m stating the fact that prior to systemd, issuing a service restart command under any Unix at all was prone to inheriting any rlimits your shell session happened to have, which could in turn lead to unforeseen consequences like sudden memory/file handles failures or sluggish I/O, depending on how shell sessions are being set up.

Implementing a service manager that can understand and interpret systemd unit files for FreeBSD would require it to be based on completely different kernel mechanisms than Linux, feature parity aside. I can easily see that people with enough skill won’t see the need to be bothered to write such a piece of software, and those who don’t will just shrug and stay on Linux.

And I think "daemonize" might have been the first? One of the earliest at least, it turns a single process into daemon but doesn't have an overall system command to handle them.