Nevertheless, the point of software freedom is freedom. I'm not upset about systemd as long as I have other choices.
It's the tendency of systemd users to say "shut up, you don't count, you're just a minority and you don't have anything real to complain about" and otherwise forcefully evangelize for their favorite paperclip maximizer that irks me.
You are free to fork whatever part of the Linux stack you want and modify it to your liking.
"Maintaining" that few lines of shell code that start/stop/check some program is incomparable to mainatining source code so can't be serious reason for demanding of removing them from existence.
And from that little scripts you literally know everything about starting/stopping managed program. Compare this to systemd undocumented, buggy and not working as expected "configs" :>>
Of course it's possible to make mess with scripts. But you can't manage to mess script so badly it becomes so monstrous as systemd :)
And you realy can't include so many CVEs as systemd introduced - that brain-dead not-a-init moved init process to ranks of sendmail and bind... Well done ? Works for me ? Minorities only problem ?
Unixes have this nasty property that forking new processes tends to inherit all the attributes of the parent process, and shell scripts are really good at making sure all the attributes are passed by default unless you bitch and complain and try really hard to not do so. Things like signal masks or environment variables, etc.
If you wanted a system where a service you're setting up runs differently because it was invoked by init on startup versus invoked by someone over an ssh session versus invoked by a different user over an ssh session versus someone running in a terminal in an X session, well, init scripts are a great way to do that. If you think such a system is horrific for debugging purposes and should be avoided at all costs, you're going to start by avoiding shell like the plague. (Also, shell is just an atrocious language for most tasks.)
Good luck debugging, fixing and splitting or just modifing or twiking systemd implementation :)
So what deserve bigger "avoiding like the plague" ? Possibility or not possibility ?
The first problem is you can only write a shell script to be defensive about the things you know about. Do you personally know which environment variables need to be reset to their default value for your service to work correctly?
The next problem is that there's actually some inheritable process state you can't manage with shell builtins. Combine that with the above, and it really makes sense for you to have a utility that knows how to spawn a service in a pristine, controlled environment.
While we're working on that pristine, controlled environment tool, we should also reflect on the fact that process management in Linux is a real complicated bitch. Simple is invariably neither robust nor correct. If we've already got a utility to help us write a services, we might as well extend it to be able to help with detecting stuff like "is this service still actually running or did it somehow fart itself and die?"
Of course, once you have this tool, you look back at your new init script and realize that all of the work you have to do is now in this tool, so why should you have to bother with boilerplate in a defective-by-default language [1]?
> Good luck debugging, fixing and splitting or just modifing or twiking systemd implementation :)
I've had more issues debugging init scripts than I have with systemd stuff. I actually find debugging easier with systemd... it actually tells me when things go haywire!
[1] Try having directories with spaces in their name with shell and see how often you get tripped up by it!
You completely miss the fucking point that UNIX is DESIGNED NOT TO BE CORRECT
If you don't understand the basic concepts of "new jersey style" you've immediately disqualified yourself from making any further comments, no matter how many essay length comments you write
I couldn't care less about design-by-ideology when I'm paid to design correct systems.
Maybe, maybe it can be done in some way, whatever 'it' is.
> you can only write a shell script to be defensive about the things you know about
And that is a problem strictly unique to shell scripting ? :) With systemd you know ? Or pick one arbitrary thing and just deny other possibilities ? Of course you deny (you as in the systemd implementer / beliver / user), as has been seen many many times. Suddenly usecase has been changed ! And maybe now you can do that with scripts even better then with systemd ? :)
> inheritable process state you can't manage with shell builtins
Is "builtins" a key world here ? Becouse shell scripts are quite literaly about using not build in pieces :)
> spawn a service in a pristine, controlled environment.
See ? Use case changed. It is no longer "user" or "other user", nor ssh or console or interactive, nor txt or X or W... Use case refactoring :) You can rething how to script it to not loss functionality.
Oh, wait... It's systemd ! Functionality loss is a motto there :) But scripts need to handle orginal usecase, for PR reasons :)
> process management in Linux is a real complicated bitch
nixes are complex. Lastly Linux have even more namespaces, contexts, etc. And you know what ? Systemd do not helped to make it simpler. Just wrapped some of them, badly (context v1 for years!) into internals and hijacked development of sane and modern system utilities.
> Simple is invariably neither robust nor correct.
Luckily we talking shell scripting here :) Becouse any system utility can be used. And they can be combined even ! Shocking ! ;)
> If we've already got a utility to help us write a services, we might as well extend it to be able to help with detecting stuff
Valid use case. Had been done ages ago. In modular fassion. With possibility of replacing monitoring part into other implementation. Can be even started from init.d script :)
> "is this service still actually running or did it somehow fart itself and die?"
And this is working on systemd ? :) Working better then in other service managers ? How systemd detect such conditions that other managers can't do that ? :) And why systemd display that not-funny messages of waiting for service to do something ? And permamently halting system halt ? And making my screen / tmux not working ? :)
> > Good luck debugging, fixing and splitting or just modifing or twiking systemd implementation :)
> I've had more issues debugging init scripts than I have with systemd stuff.
I have more problems with systemd configs then I had with using init.d scripts - they are just like command line(s), sequencial execution, easy to debug by just looking on them and checking system / app state. And usually it's not script problem but something with app. How systemd can improve on that ? By blackboxing managing service ? :)
> I actually find debugging easier with systemd...
Maybe. But just wait systemd will make debugging effort poinless by changing systemd behavior :)
But you missed something: with pure scripts or simpler managers you know everything* about system you are running. With systemd you don't - you introduce additional complication. And constant CVEs stream. How that is easier to debug ?
> defective-by-default language / directories with spaces in their name
On contrary, *nix shell scripts are perfect for work they are doing - batching commands you type into pack for re-execution. Tested commands that work as expected. And "spaces" problem is solved. Do tar or cpio in script have problem with directories with spaces ? Do ls, find and others have options for better separating things ? Do shell allow '""' usage ?
Thing about scripts is that you are supouse to stop using them when usecase is more complicated. This is counted as +1 for scripts and +1 for init.d usage (and -1 for systemd monitic monster). Scripts work is just to be agregators for fast and clear development eg. for start / stop / check helpers that you copy / paste almoust literally. Just like configs in systemd :)
Edit:
Btw. Hey, I don't specially like init.d - it works, is simple, extendable, replacable in few hours, etc, etc. Just systemd is such monstrous insanity...
If I run /etc/init.d/foo start to start a service, the service is forked from my current shell and therefore inherits everything from the shell. If I instead run service foo start, the tool instead sends a message to PID 1 process to fork the service, inheriting everything from PID 1. At that point, anything that can be changed could only have been changed by systemd itself, so if systemd doesn't know about something, then it can only be in the default state.
> And "spaces" problem is solved.
No, it's not. Write a shell script that reads a shell command (that contains quoted arguments with spaces in them!) from a file, appends some extra arguments to that command, and runs that command. The only way I could get that working was to go through Python instead.
'su' and 'env' helped a lot all that decades. Until everyone started using sodo passwordless :)
> If I instead run service foo start, the tool instead sends a message to PID 1 process to fork the service, inheriting everything from PID 1
Wait, you just want clean service ? I thinked usecase need to recognize how it is started and react to that ! But ok, send a signal 9 and inittabzerod will fork it with inheriting everything from pid 1 :)
> > And "spaces" problem is solved
> No, it's not
Ok, it isn't :) They even rewrote git in C to use file descriptors instead of text paths. But moustly it is becouse it is a very known problem with decades of solutions already implemented in common tools.
> Write a shell script that reads a shell command (that contains quoted arguments with spaces in them!) from a file, appends some extra arguments to that command, and runs that command
So: do shell meta programming in shell ?? :) That's clear abuse becouse shell is not general purpose programming language.
And how you do just that with systemd ? :)
But if you want some editable template file then oneliner in sed or awk or perl or ... with some structure will do. No need for introducing CVEs with new and soon to be rewriten or removed or abandoned parser somewhere in milions of lines.
* Config files and startup behavior are all in the same format; outputters for name daemons, cron jobs, networking, name resolution, NTP, coredumps, mountpoints, and more are all the same. Hand it a data structure with the proper keys and you know it's going to work.
* cgroup and namespace configuration are much more fine grained, flexible, and straightforward than docker. Have a weird vendor service that you'd like to restrict or isolate? you can do that.
* Process management is mostly a solved problem after years of being ignored by POSIX.
* Accounting metrics on memory, tasks, and I/O is for all your services is there
* Shipping to syslog is a breeze.
Yeah, it's got a learning curve but it's objectively better than a bunch of random init scripts. Which you can still use.
Logs are text, tools that work on logs expect text, and I don't give a crap that my logs are 50% smaller or whatever. Disk space is absurdly cheap, and logs are a minority of my disk usage.
I know it can forward to syslog, but at that point I'd rather just have syslog.
systemd is fantastic, though. I've just been building a new system and having to deal with journald is a big pain in the butt.
I do.
I want my (e.g.) auth.log rotated regularly and kept forever. Many other things I only care about (say) 4-6 weeks of retention.
(This is in addition to off-host log shipping, which of course journald doesn't do itself so I have to run rsyslog regardlesss.)
I'm often both the producer and consumer though, and the consumer side is painful enough I tend to avoid journald.
From the producer side, I typically use a logging library/extension that handles its own log rotation and doesn't require logrotate. It's a half-dozen lines of code or so, not too onerous.
you can process millions of lines of plaintext in a tenth of a second using awk
It's just a silly use of a database. I could probably count on my fingers the number of times I wanted non-sequential log records, and that's the only time I can see a database beating log files. Even if I want non-sequential records, Linux has a plethora of tools to manipulate and query plain text that everyone already knows. I would much rather use grep or awk or another tool I know than learn whatever arcane query syntax journalctl supports.
They could have at least not re-invented the wheel: perhaps use SQLite (or OpenLDAP's LMDB) instead of DIYing it.
> The gory story begins with their journald discussion, here http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/69... where they rationalize why they created their own data structure rather than using an existing embedded DB. Aside from their claim that nothing suitable existed being wrong (LMDB belies those claims) the fact is the solution they developed is inherently unreliable https://bugs.freedesktop.org/show_bug.cgi?id=64116 which utterly invalidates their claimed attention to robustness.
* https://www.linkedin.com/pulse/20140924071300-170035-why-you...
* You get real honest-to-god dependency solving, no more having to number scripts so they run in the right order or working with magic comments.
* .targets are the correct abstraction over runlevels that do what people actually need them to do.
* How journald manages disk finally fixes the stupidity of logrotate edgecases.
* sysusers/tmpfiles is by far by far the best way to manage non-human users and application specific directories.
* The entire system is programmable in real programming languages without having to shell out to system("systemctl start ..."). The whole thing is dbus-first and systemctl is just a client to it like any other.
* You can make your own unit types with systemd-generators if the built-in ones aren't enough for you.
* The system for overrides finally solves the package management bullshit where the init script and the package manager fight.
* Built-in userspace oom killer.
* Makes user sessions a real thing on Linux instead of an ad-hoc set of conventions.
* sd-notify for service readyness checks is fantastic
* Parameterized services!
Bold statement to make.
"It works", yes, it does but I still beg to differ.
I've always encountered issues with it. Services failing to shutdown, throwing me timeouts of x/y requiring of attempting z tries.
Which as experienced within an install of Ubuntu Server a few days ago; nor have I seen systemd-resolved work either.
So nobody can express their frustrations with it without being written off as just a "vocal minority"? That's pretty sad, in my opinion.
Is it possible to tell the difference between a demographic minority of people who are (all/largely) vocal, and a demographic majority of which only a small number are vocal?