Is this an apt comparison for systemd, or is it way better/worse (I'm not an expert, so I'll leave the qualitative opinions to others!) than that?
Is this an apt comparison for systemd, or is it way better/worse (I'm not an expert, so I'll leave the qualitative opinions to others!) than that?
In systemd, services are described in a simple file with a few keywords, and systemd tries to do all the magic itself, in a way replacing the scripting part and all the possible code paths that could be gotten that way.
So if something in the system's boot or a process' start-up procedure doesn't work now, it's systemd's fault and not yours or whoever wrote the shell scripts in other init systems; and if the simple configuration file is not complex enough to do something you could do easily with a shell script, than it's also systemd's fault for being too simple.
I'm an old-timer and I like shell scripting, but also think systemd makes writing service files easier and has benefits such as built-in support for cgroups, security features (user/group, chroot, ...) and mini-services like basic ntp server. There were some bugs when distributions started to include it by default some years back, but I haven't had any problems lately.
So rather than building the necessary complexity out of simple, understandable instructions which can be presented on-screen in full, it hides its complexity under a very few complex, frequently badly-named instructions which are certain to be poorly documented even for Linux's standards.
Sign me up! I'll be unfirable!
[Unit]
Description=Some description
[Service]
Type=simple
ExecStart=/the/service/binary
[Install]
WantedBy=multi-user.target
The rest is stuff on top (user/group, namespaces, cgroups, stdout redirection, socket activation, ordering, etc.) Actually running the services instead of forking them also allows you to get rid of lots of silly pidfile handling options.This might look simple, because "Hello world" is simple in most languages. But if you really work with them, you will encounter many hidden complexities.
Systemd being responsible for daemonising also removes several corner cases I could screw up on daemon implementation and saved me time.
All in all I had a much easier experience that I did with similar tasks on SysV.
But in practice, the description of all of that is still simple. Have a look at your service descriptions in /usr/lib/systemd/system - there will be a few services with crazy dbus activation and a long list of options, but most of the others are quite simple and the extra options are only to make it work better, not to make it work in general.
And being able to simply set things like NoNewPrivileges, MemoryDenyWriteExecute, and Protect* without going into LSM profiles is a great simplification.
A colleague of mine had the problem that one of his applications was shut down because the user context which this service belonged to, logged out/disconnected (I think it was a system user). So he had to hack something together to ensure that the service is not affected by this.
No thanks.
Allowing any process to linger around by default is just stupid, which is why "Or just add 'KillUserProcesses=no' to /etc/systemd/logind.conf." is as horrible advice as "just add your own user to the root group".
That’s something no other competitor has provided before.
The way to fix this without disabling the feature is by explicitly putting the process in it's own scope. That doesn't take special permissions to do, it's just that it needs to be done explicitly instead of just ignoring SIGHUP.
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825394#221
https://lists.freedesktop.org/archives/systemd-devel/2016-Ju...
This being said, upstart has a similarly simple setup. Any time I have to fiddle with sysv init files, I long for either of upstart or systemd.
Turns out you need to figure out After, KillSignal, pidfile, and some options in uwsgi configuration itself. Oh, and "Type=simple" doesn't work, you need forking.
And this is poorly documented, it's hard to find materials en the web to help you and you are reduced to make many trial and errors with systemd itself giving you few clues of what's going wrong.
It's, however, easier that bash scripts, so it's an improvement.
The documentation is not that bad but declaring with configuration what you programmed with a script has some limits. Basically you have to learn another language on the top of the scripting one that you still have to use in other parts of the system.
Nevertheless I found that past that point it's easier to read a short configuration file than a long init script. I didn't run in big problems so far, but that systemctl reenable is wierd. Why can't it figure it out by itself?
Why would you not use type=simple?
That said, two of us have already pointed out in this discussion where other doco exists for the subject at hand, outwith reference manual pages.
You could have also just copy/pasted the examples from the uwsgi documentation.
Not understanding how the daemon forking works is not the same as systemd being complicated.
Exactly what I'd need to do to be able to put a #! on the line before is slightly more complex and you won't be able to reason about it yourself except by guesswork but that's alright because I've got it right. You can trust me.
sysctl has nothing to do with systemd though.
For now... /s
systemd-sysctl exists already. (Okay, but its not a replacement for it)
Those old init scripts weren't simple - to do anything useful you had to copy and paste a whole heap of sh boilerplate...
This is my regular problem in systemd arguments. I understand learning init script - and bash as a consequence - can be tiring, but judging a software by how easy or not is it to configure is utterly and fundamentally wrong.
After a certain point, systemd is not easier to configure than any earlier system; nor is it any more stable, or, god forbid, easier to replace a part of it.
Please stop glorifying things that you're only touched the surfaces of.
I don't care if it's easy to replace bits of - the people who produce the distribution I use can worry about that. All I care about is that it has worked really well for me in production and I have found it much easier to use and maintain than older systems.