174 points · by geoffbp · 11y ago · 245 comments
There is a lot of development in the ecosystem dominated by Freedesktop.org, Gnome and (to some degree) large commercial players like RedHat and SUSE. It's more efervescent than it's ever been. Fifteen years ago, I'd have been ecstatic to see so much development being done.
Yet for all this fierce code churning, there's absurdly little innovation. Even in systemd, there's a lot of focus on non-issues like booting without needing a shell, while still inventing service startup notification types because none of the gazillion startup notification types already existent can actually solve precisely the problem systemd claims it solves -- managing complex startup chains.
In the last three or four years, my Linux systems have become increasingly blackboxed, and consequently harder and harder to configure, let along debug when they stop working. Over the span of six months, a tool you just got to learn how to work with (mostly because the documentation seems to have been written by very bored and very verbose monkeys who had only a typewriter to pass the time with) becomes obsolete or is revamped to be unrecognizable. Which would be fine if that actually solved any problems. Instead, it replaces the old set of problems with a new, even more complicated set of problems that developers claim you shouldn't have, while insisting that the old problems were simply due to the old architecture and we'll have none of that now that we have this shiny new thing.
Ironically, systemd is actually one of the better pieces of software to come out of that ecosystem. No, seriously. It's decently documented and as long as you don't need anything more complex than "here, start this daemon after this other daemon started", it does its job.
If you want to peck at something, have a look at Polkit, where someone brilliantly figured out that the best way to configure policies is to write basically undebugable JavaScript code in .rules files.
* Like pretty much anything from freedesktop.org, the documentation is a joke.
* The security system implemented through it is next to impossible to debug. It's very easy to add "allow <this thing> to happen", but I can't do things like "ok, tell me who can mount filesystems" or "give me a list of all things that users in the wheel group are allowed to do". Normally this would be trivial to implement by parsing the rule files, except that the rules are written in JS (I have no idea why) and parsed in a particular, cumbersome order.
* Probably also as an artifact of having to execute JS code to add rules, many errors are silent, incomprehensible, or occur only when a particular action happens.
* polkit doesn't have a textual interface, it only works through D-Bus. This makes it useless for scripting.
Fine-grained access control needs domain-specific understanding
This also applies to the user trying to configure it. For all the reasons listed in "weland"'s sibling comment, this is hard to learn. If something doesn't work in polkit, and you're not completely familiar with it, it's very hard to make it work.
Yeah, i've been thinking the same recently.
The current development above the kernel seems to either be from the desktop down, or from the point of view of managing 1000s of headless instances in a "container" farm.
This with a side-order of Windows-isms demanded from corporate/government clients looking for a way to get away from MS while retaining their centrally controlled fine grained access control.
Ha. FreeBSD here.
And so long as you get the right hardware, I find BSD to be far simpler than linux distributions out there.
Ports? Beautifully elegant and simple. Configurable. Magnitudes easier than configuring rpm/debs.
Getting a package approved in debian? Alioth? No offense, the wiki, all these pages on the debian website - they have no concept they have of "Handbook", in the sense FreeBSD has. It's so adhoc, they're healthy, but they're in denial about how hard they make it for new people. By the time you've taken to time to learn Debian's dev warts, you're apart of the convent and no longer care about fixing the onboarding problems.
But to be fair. I have day to day gripes with FreeBSD just because we're short on the manpower Linux distributions have in excess:
On FreeBSD 10.1, chromium crashing easily, settings doesn't work. Firefox just clogs up and stops working. No skype (CURRENT will be in a better position to since epoll support has been added). No Dropbox (as of now, we don't have inotify, and kqueue may not be able to handle it, don't quote me on that).
I do my 90% of daily routines simpler and better on FreeBSD. If only Google / Mozilla (with all the resources they have) gave someone who could work to fix this stuff.
> I find BSD to be far simpler than linux distributions out there.
The way OpenBSD handles WiFi configuration is a good example of this. Want to connect to a wifi network? ifconfig <interface> <ESSID> <passphrase>. If you need some other fancy flags for those 0.1% of hotspots in the world, you can do those, too (also through ifconfig) but it's that simple.
In contrast, after everyone agreed that wpa_supplicant is probably what happened after Stalin's ethereal spirit had mad sex with Hitler's ethereal spirit and their ethereal baby was incarnated, what did we do to alleviate things in Linux land? Why, we wrote NetworkManager, of course! Conservatively, 90% of today's deployments of NetworkManager exist because no one can figure out how to set up wireless without it, and we put up with its crap because wicd is waiting for us at the other end.
Better yet, this is all nicely documented in the manpage. If you search for "wireless" in ifconfig's manpage, you find out all you need to know. Just for fun, compare that to man networkmanager.
> On FreeBSD 10.1, chromium crashing easily, settings doesn't work. Firefox just clogs up and stops working. No skype (CURRENT will be in a better position to since epoll support has been added). No Dropbox (as of now, we don't have inotify, and kqueue may not be able to handle it, don't quote me on that).
I haven't had crashing things on OpenBSD, but yeah, a bunch of things don't work. Fortunately, they're things I don't use. If I ever need them -- OH THE HORROR AND THE BLASPHEMY -- I have a Windows laptop, which for all intents and purposes is by now about as closed and as hard to wrestle with as Fedora, but at least it doesn't hopelessly break every six months. There are Linux-only things that I sometimes need because at some point between 2003 and 2013, "portable" ended up meaning "we can probably work if you have bash in a non-standard location but that's about it" (eh, Yocto?) for which a cheap VPS is more than enough. When it breaks, I don't have to spend days trying to find out exactly what part of PolicyKit broke or where my devices are mounted this week -- I just wipe everything and reinstall.
There's also the issue that the simplicity exposed in your example is a little misleading. Will the system persist that command and re-execute it on boot? Will it remember my previously used Wifi networks and connect automatically should I want that? How can I view the available Wifi networks in range? Being able to connect to a Wifi network using a simple ifconfig command is great, but the notion that your 80% of use-cases is the same as everybody else's 80% is misguided at best.
> If I ever need them -- OH THE HORROR AND THE BLASPHEMY -- I have a Windows laptop, which for all intents and purposes is by now about as closed and as hard to wrestle with as Fedora
And therein lies my problem with your entire comment. It's not that I disagree with your usage patterns, but I disagree with your assertions in light of these usage patterns. So you're saying that xBSD is simpler / better, yet you can't use it on your laptop, as it lacks things you need. Well, no shit.
$ vim /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <myssid>
wpa-psk <passphrase hash>
You can also have multiple virtual interfaces configured in the same file as above, and then just do "ifup wlan0=virtualif" to switch.Much ado about nothing.
Hmm, I'm surprised OpenBSD supports this, since it will cause the passphrase to get stored in your shell history in plaintext.
Another example: console / keyboard config. In OpenBSD, I set this up through wscons. If set here, my keyboard settings get propagated in a robust, non duplicative way to X11. Contrast this with Linux, where you need to set up your keyboard config in at least two places to have, say, Dvorak in X11 and the console.
It's a minor thing, and one that Linux distros "solve" during installation by setting up the relevant configs. But it's more elegant in OpenBSD. Maybe that's because OpenBSD writes documentation that answers questions like, "How do a change my keyboard layout?" In OpenBSD, it's a simple answer. If the situation were the same as Linux, the answer would be longer. Maybe seeing that inessential redundancy in print is what spurs the project to action.
What sort of hardware are you running?
What about Adobe Flash on OpenBSD?
There didn't seem to be an equivalent of Debian's Stable, everything was apparently the latest release.
Red Hat seems to be fine with yum, and I haven't had a problem yet. FreeBSD's pkg (pkg-ng technically) is ok, but I keep running into problems on upgrading because someone split a pkg or renamed it. I search but don't find a simple solution. I haven't had any problem on the OpenBSD side, but that could be because every 6 months do an upgrade with the new release. Patches are a bit harder on OpenBSD unless freebsd-update does something weird. the whole src thing in the freebsd-update bit me.
I don't have the issue with Firefox, and never had any issue using the latest hardware, and I don't think the lack of Skype is FreeBSD's fault either but I forget.
For the other Sun folks from the systems group who quit rather than submit to the demands, you were right, I was wrong. We couldn't convince them of the error of their ways.
I kinda had the opposite impression. I first encountered systemd when I started messing around with arch for a couple little vps projects. At the time I was doing sysadmin that involved both Ubuntu and CentOS, and I definitely found day-to-day tasks easier with systemd (better built in monitoring, consistent syntax, etc). For simple cases, writing a unit file sucks a lot less than writing an initscript. The warts in systemd only started to irritate me when I was first setting up my personal machines (one laptop, one tower) to run arch [1]. Even then, the bloat in the design irked me more than actually using it. So, I'm in favor of systemd, but not thrilled (dbus everywhere is annoying).
Then again, I don't maintain any packages with strange and/or complex daemons. If anybody's had a really hard time getting their stuff to work with systemd, I'd be interested to hear stories.
1: Not completely true. I want my damn log files back.
For people who are less experien^H^H^H^H^H^H^H^Hcrusty :-), init scripts look like a horrifying way to manage a startup process, and just about anything -- including Yet Another Config File Format -- looks preferable.
I think this is also why so little progress is being made on resolving conflicts over systemd. There really isn't a whole lot of room for compromise; one group simply wants things to stay more or less the same (or evolve incrementally), the other group simply wants to throw it all out and start over.
I bet there would've been a lot less argument and vitriol about systemd if Debian hadn't made the decision to default to it, basically leaving all the crusty sysadmins homeless. Once Debian switched, there was a near guarantee that all of Linux was going to move to systemd. That suits one group just fine, another one not so much.
On the plus side, the BSDs should be seeing a really nice upswell of installations over the next couple of years, which is great, because they've been quietly building some pretty great operating systems that deserve more love.
Speed was certainly a major motivator as well, considering the increasing popularity of containers and on-demand virtual machines.
To me it seems that "gradual evolution" was exactly what they did, and it wasn't really going anywhere. Lennart came up with systemd and convinced enough people that it's worth the pain of migration to get a clean start.
I don't know how to write sysvinit scripts any more than I know how to write fizzbuzz. What I do know is how to program and specifically how to write and maintain and debug shell scripts. I NEED that for other automation purposes and cannot get rid of that mandatory requirement so it used to dovetail quite well with init scripts. There are corner cases and security issues and tradition, which means copying a known good init script and editing nothing but the executable names is a great start, but its not really a serious problem. I don't care if its verbose, as long as its simple and understandable and most importantly, predictable.
Now instead of applying a language and tradition I know to a simple task like init, I get to learn a whole new ecosystem and technology to do about the same thing I always did except vastly more complicated, and I can't even shed the old knowledge because its needed elsewhere. That makes overall systems harder to use, slower, buggier, and less reliable. And thats defined as "progress" because its new so it must be better.
# cat smtpd
#!/bin/sh # # $OpenBSD: smtpd,v 1.4 2012/10/26 06:51:59 ajacoutot Exp $
daemon="/usr/sbin/smtpd"
. /etc/rc.d/rc.subr
pexp="smtpd: \[priv\]"
rc_reload=NO
rc_cmd $1
One may think about systemd's unit files as a set of shell variables that gets sourced by the real script.
I don't see why you should feel homeless.
daemon="/usr/local/sbin/dovecot"
. /etc/rc.d/rc.subr
rc_cmd $1
Pretty straightforward: you set $daemon to the path of your daemon's executable (in this case, dovecot), source in rc.subr, and call rc.subr's rc_cmd command with $1 (which represents a command, like 'start', 'stop', 'restart', etc.).rc.subr, meanwhile, holds all the complexity one will ever likely need in an initscript, in the form of various shell functions encapsulating things like starting, stopping, etc. And if that's not enough for whatever reason, it's easy to add more functionality either to the individual initscript or to rc.subr, since it's shell scripts all the way down. In my experience, reasoning about this sucks a lot less than writing a systemd unit file, let alone an initscript on a system without such niceties.
In part part the reaction is to the boilerplate nature of sysv scripts, as they bring all their logic with them.
but if you glance outside the RH/Debian sphere you find the likes of Slackware, that has been using BSD style init for decades.
* Slackware doesn't use a BSD-style /etc/rc.conf. Instead, daemons are enabled/disabled by setting the executable flag on each initscript. While this loses some of the features of /etc/rc.conf, I personally like this method better.
* Slackware doesn't include an equivalent to /etc/rc.d/rc.subr, which means there's a lot of boilerplate in its initscripts.
But yes, systemd's primary objections to shell-based init systems in general seem to stem from a limited scope.
But you often want some confidence that the change you're making to your system is what you expect, and we've had them all along:
- visudo(8) sanity checks, for atomicity and syntax, to help prevent you from bricking your authorization
- an explicit SIGHUP to reload the configuration file for your daemon, after you've checked the config, rather than accidentally saving your file while you're editing it and bringing down your daemon.
You could expect everyone to adopt new practices for editing the configurations, but the behavior would be very surprising to anyone used to the old way.
> ... and config/daemon reloading as things that could be made automatic, I'm assuming with e.g. inotify change events.
is a misinterpretation of the author's complaint. It sounds like with systemd, if you tell it to restart a service it will continue to use the old definition until you run a separate command to 'reload' it (and, presumably, all other configurations). On top of that, it indicates its knowledge that you've changed the file by telling you to run the aforementioned reload command.
No inotify seems to be involved in what he wants, which is that the reload command use the new configuration. Hell, be clever and use the old configuration's stop mechanism and the new one's start mechanism or complain if the restart mechanism differs or something, but a message telling you you didn't do something you almost always want to do is a pretty obvious smell for a UI problem.
I deeply dislike the similar behaviour of upstart, fwiw. In order to reload an upstart init script you have to stop and start it, restart uses the old one. I have spent annoying amounts of time wondering why it was doing it wrong.
This is very important when you consider that unit files can kill other units on their conditions - I've used this feature in particular to make sure nginx goes down if a mountpoint becomes unavailable or the servicing process dies (and systemd can't restart it). This is extremely useful because it means a load balancer won't send requests to a webserver in an improper state. But it also means that while editing those config files, I wouldn't want systemd auto-reloading everytime I saved.
Editing a file and saving it multiple times is not an atomic operation, but reading a file can be, so having the user issue a reload command only after he's finished editing a file is an entirely reasonable approach that has been used in Linux since forever and it only shares some basic building blocks with version control or transactions, but there's nothing fancy about the approach. Fancy and very error-prone would be to apply configuration changes automatically, which is what the article seems to suggest.
In other words the joke is lame :-P
Actually, it's not that bad an idea:
cd /home/efaref/config/servername
vim blahd.service
git commit -m "Update blahd service file to increase widget count"
git push live master
Then have something else watching the master branch of the live repo do a git pull, systemctl daemon-reload. It doesn't even have to live on the same server. If one of the config files is a puppet script, you can maintain everything.How that's different from sysvinit?
> The longstanding /var/log/messages is now replaced by journalctl tool, and the logs are actually in binary.
`journalctl` prints plain text on its stdout, so you can think of it as a glorified `cat` if you don't want to use its extra features. On the contrary, if one needs its extra features on plain text log files one usually resolves to using fragile parsing hacks.
> The venerable "hostname" command is now "hostnamectl" because it must go through systemd
They do different things, `hostname` only reads the current hostname. `hostnamectl` is able to set the hostname, standardizing what used to be a per-distribution custom mechanism. Despite being shipped with systemd (to make sure everyone can rely on it) it doesn't actually depend on systemd and in no way goes through it.
> They have also replaced chroot with systemd-nspawn, and made it so you cannot even use systemd while in a normal chroot.
`chroot`'s purpose has never been the ability to run an init system inside it, no matter if it is sysvinit or systemd. On the other hand `systemd-nspawn` creates isolated containers, I'd be surprised you can't run sysvinit inside it.
Again, you're comparing apples to whole orange trees as the systemd utilities do much more than the traditional ones you mentioned.
In sysv I can just make a list of startup tasks. A -> B -> C -> D. Easy. 10 things that must start in specific order? No problem, 10 things in list. There is no easy way to do this in systemd. I must create 10 different unit files, and then create a bunch of different dependencies (A depends on B and C, B depends only on D, can C then start at same time as D?, etc). When those dependencies change, I have to go look through a whole bunch of files or look at a graph tool to figure out what is even going on.
> They do different things, `hostname` only reads the current hostname.
That's... not true. From the first line of the hostname manpage: "Hostname is used to display the system's DNS name, and to display or set its hostname or NIS domain name."
> chroot`'s purpose has never been the ability to run an init system inside it
That's fine, but it worked under sysv and now it doesn't. When upgrading or working with different install roots, using chroot is common. Now I can't modify services during that time, unless I migrate everything over to use nspawn.
> the systemd utilities do much more than the traditional ones you mentioned
If I lived in a blue sky world, where I was fresh installing one new server with a simple set of services that I had built in systemd, I think I be quite happy with it. The problem is that I have thousands of servers, and a decade or more of accumulated infrastructure that relies on those traditional tools. Then systemd comes barging in and breaks a bunch of stuff, and that is frustrating. I'm not saying I hate systemd, in fact I agree that many of the new tools are quite nice. But it's kind of like the loud hipster that shows up at your party and starts talking shit about the music you are playing, and making fun of your choice in beer. Maybe my music does suck, and maybe these clothes aren't cool anymore, but we were sitting around having a fine time until he came around.
Systemd is not built for traditional server farms, it was initially built to scratch a desktop bootup itch that Poettering (and perhaps Sievers) had that then got extended to deal with booting containers.
To them, and others working on systemd, the traditional server way is history and they are building for the containerized present/future.
Oh, sure, sequentially starting up a fixed list of services is probably easier with sysvinit, given that's the only thing it does.
With systemd you probably want to set Requires=foo and After=foo in bar.service to have foo running before bar. It does not seem overly complex, or you meant something else?
> I must create 10 different unit files, and then create a bunch of different dependencies (A depends on B and C, B depends only on D, can C then start at same time as D?, etc).
Wouldn't you create 10 different init script for sysvinit, each with its own LSB header listing the dependencies such that tools like Debian's insserv could correctly schedule them?
I'm quite sure that it's far easier to express complex dependencies with systemd than with sysvinit, if that's your concern.
Correct me if I'm wrong, your dependencies could be handled like the following:
[A] Requires=B Requires=C
[B] Requires=D
If A needs B to be running before A even starts (ie. they cannot be run in parallel) just add After=B to A. With sysvinit I'm not sure if there's a way to say that A needs B but that they can be started in parallel.
I don't get your question "can C then start at same time as D": if they do not depend on each other, I don't see the problem. If they have a dependency, just add After= to the one that needs to be launched later in the process. If you don't know, add After=C to D and you've got a slightly slower but sequential boot as with sysvinit.
> That's... not true. From the first line of the hostname manpage: "Hostname is used to display the system's DNS name, and to display or set its hostname or NIS domain name."
Oh, indeed, sorry. I then guess `hostnamectl` only provides notifications and some extra info on top what `hostname` already does.
> If I lived in a blue sky world, where I was fresh installing one new server with a simple set of services that I had built in systemd, I think I be quite happy with it. The problem is that I have thousands of servers, and a decade or more of accumulated infrastructure that relies on those traditional tools. Then systemd comes barging in and breaks a bunch of stuff, and that is frustrating. I'm not saying I hate systemd, in fact I agree that many of the new tools are quite nice. But it's kind of like the loud hipster that shows up at your party and starts talking shit about the music you are playing, and making fun of your choice in beer. Maybe my music does suck, and maybe these clothes aren't cool anymore, but we were sitting around having a fine time until he came around.
I totally understand your concerns. I guess you don't have many options: you can stick with sysvinit for a while (eg. Debian still officially has full support for it) and in the meantime start making sure your scripts run fine with the LSB compatibility support in systemd (if you're just starting services they should work transparently with no effort).
But consider that in any case, staying with sysvinit has never been an option: during the Debian debate, the contenders for the default were systemd and Upstart, sysvinit has always been kept only as the baseline to test compatibility.
With that in mind, the LSB support in Upstart (and in every other contender) is far less mature than the one in systemd. As the incredibly smooth migration done by the Debian systemd team proves, systemd has the best compatibility support of the pack.
(I mention Debian as that's what I use and for the fact that the systemd maintainers poured a big deal of effort to provide the best systemd/sysvinit compatibility)
None of these reflect the Linux I grew up with. Thus, I am not a fan of systemd. #notmylinux
IMHO systemd is taking much of the hacks and weird glue that has historically held distributions together and replaced it with an active upstream project. Maybe some of the solutions they've come up with could need some improvements, but I have much higher confidence those improvements would happen now compared to how things used to be.
Nowadays you can code something up and come to the systemd mailing list and get feedback and get it integrated. Previously you'd have to convince one or more not-really-connected distro hackers that your new fancy thing is worth rocking the boat for.
In theory, yes, it should be the way you mention it. In practice, even bug reports end up unacknowledged and labeled as features after a few philosophical debates.
No one who has used more than one Linux distro would disagree that a unified system to control init services is a good idea. It's this particular implementation that's problematic, not the principle.
This came up in relation to a systemd set environment variable that would break software by overwriting one user's config files with that of another's.
The variable was apparently set that way because of pulseaudio.
The really worrying part was any lack of "mea culpa" from Poettering once someone outside the bug report told him that pulseaudio could be changed so that the variable was no longer needed and Poettering implemented that change.
Instead he just left the bug report hanging, and others had to report on the changes and declare the issue sorted.
In practice, even bug reports end up unacknowledged and labeled as
features after a few philosophical debates.
Where is the evidence?Our CPUs got fast enough and our use cases so diverse and network dependent (leading to lots of idle CPU time) that we stopped worrying about raw performance above all else. In nearly every case where you're not doing something glaringly stupid, performance is a function of the complexity of your problem set. Things like power consumption and safe asynchronous communication are more important than raw speed, and these things need to be coordinated through the same interfaces on every Linux machine (though not necessarily through the same methods).
Systemd doesn't so much fly in the face of "open architecture" as it does introduce architectural concepts that are sufficiently abstract that much of the community doesn't fully understand them. But this is complexity for the sake of flexibility -- which is far easier to deal with than complexity for the sake of performance. Best practices around specific use cases will eventually become common knowledge.
In fact, sysvinit's purely synchronous nature and its reliance on the patterns of symlink farms to represent system states in the form of "runlevels", along with the tendency to write bloated shell scripts for it because no one ever bothered to write a proper rc/service runtime framework until much later (in contrast to the BSDs), meant it was slow.
IIRC, one of the motivations for some distros to symlink /bin/sh to dash was to reduce boot times. Then we got ugly hacks like startpar for asynchronous script executions, insserv for parsing dependency directives inside scripts, and Debian had all the cruft behind sysv-rc just to make managing the runlevels easier.
The whole thing descended into an unmaintainable mess that performance improvements in systemd and other alternative systems were unsurprising.
But flexibility and modularity is more important now than maintaining compatibility with decades old init scripts. Some of those modules may need low level system access for a variety of good reasons. The kneejerk reaction is to apply network server use cases to every Linux feature, but Linux is a whole lot more than a network server these days.
Once systemd starts to get traction, it's cognitive overhead is going to become a real problem for sysadmins who want to be able to model the entire boot process and run-state in their head.
For better or worse (I honestly don't know which, btw), you are going to have to start to trust the operating system to manage its boot process/run-state correctly rather than having it be a direct implementation of your mental model. (I would argue other *nix Operating systems, like OS X, have, to some degree, been doing that successfully for a while, so it's certainly possible - just not clear whether you want that type of behavior on your server systems. I guess time will tell.)
Writing init scripts used to be a real pain, now I can set up a unit file in two minutes and it works...
Maybe there's something to be said for "sysadmins who want to be able to model the entire boot process and run-state in their head" but with correct information about dependencies and so on, I personally think that's something computers are a lot better at solving.
This.
I'm not saying systemd is the best answer, but I really think sysadmins could learn a thing or two from developers. Nearly every custom init script I've ever seen has bugs, and isn't portable between systems. Where are the unit tests? Code reuse? Focus on maintainability/readability?
Shell scripting used to be amazing, but as a language these days it's behind the times.
Don't throw stones in glass houses and all that. We all could stand to learn things from other people.
Sure, sysadmins could stand to be better programmers, but software developers tend to forget that software is just a tool, and sysadmins use it like a tool. They just want to get in, get out, and move on to the next problem, so for them, certain best practices in software development aren't all that attractive.
It was never amazing, was given far too much credit, used too widely, and brought up a generation of people thinking that this is the way to manage a complex web of dependencies.
On the other hand, constraints like the above tend to foster creativity, so perhaps that's why people have been so nostalgic for this way of solving the system startup problem.
>Nearly every custom init script I've ever seen has bugs, and >isn't portable between systems.
Nearly every custom init script is written by a developer for the product you desperately have to run because development wanted it, not bothering to give us sys admins time to look into the: packaging, configurability, operability and if a custom module/cookbook/playbook needs to be written.
>Where are the unit tests? Code reuse? >Focus on maintainability/readability?
If we were given the time, it would be there. My deadline for almost all work I do is "yesterday".
Shell scripting is still amazing... when you use it for shell scripting.
Now I do like systemd more, but not because init scripts are bad, I just prefer how it does things, and can always call out to a script if need be anyways. And I suppose making it more friendly to developers is going to make my life easier too, the atrocities I've seen written in every language imaginable to replicate something that would be trivial to do in an init script. I didn't think it was possible (well possible yes, but why, WHY) to essentially rewrite the userland tools and the job of the init system in (very poorly written) php, but I've been proven wrong. Even something like forever for nodejs doesn't really have a need to exist.
But point is developers and sysadmins are both more than capable of writing shit code, lacking tests, code reuse, and all the rest of the best practices. At least we have to deal with the fallout from our code ourselves ;)
I've always found init scripts straightforward to read and write, even though I don't develop them often.
I don't care for the upstart/systemd/OSX approaches. I don't want to digest another manual to do what I can do in bash easily.
If your needs are complex, you have better chance by mixing different options in the completely declarative syntax of systemd than mixing shell snippets from different scripts using different styles.
In any case systemd happily launches LSB-compatible init scripts, you literally don't lose anything.
> Writing init scripts used to be a real pain
In the GNU/Linux world, yep, this is the case. Lots of copypasted boilerplate that becomes a nightmare to debug.
In the BSD world (at least with OpenBSD, where I'm most experienced), this isn't the case at all; OpenBSD ships with /etc/rc.d/rc.subr, which one can (and should) source into one's initscripts to make life much easier than even (in my experience) systemd's unit files. Set the $daemon variable, source in rc.subr, call rc_cmd, done. Sure, you might want/need to read a couple manpages, but this is the case with systemd, too.
Back to the GNU/Linux world, the complexity of SysVInit is not a hard dependency of using shell scripts for daemon management; there's very little stopping a GNU/Linux system from adopting a BSD-style rc system, rc.subr, etc. and making life significantly easier for sysadmins. Alternately, there's very little stopping a GNU/Linux system from implementing shell scripts in something significantly less horrendous to use, such as an interpreted scripting language (like Perl or Python or Ruby). SysVInit and BSD-style rc-based init both have a distinct lack of hard requirements on how initscripts are implemented, so long as said scripts are valid executables.
> Maybe there's something to be said for "sysadmins who want to be able to model the entire boot process and run-state in their head" but with correct information about dependencies and so on, I personally think that's something computers are a lot better at solving.
Would you not want to be able to model the startup process and run-state of the software you write in your head? Why should the underlying operating system be any different? If you have to rely upon external tools just to be able to reason about the execution flow of something - your server, your program, your recipe for lamb vindaloo, whatever - chances are it's way too complicated and needs significant refactoring.
And because of that, developers then target RH related choices as a baseline, further exasperating the inbreeding.
I'm also a developer and for example one problem I had with my servers on AWS was that my process sometimes happened to start before my volume meant for logs was mounted, which meant that all logs were going to my primary volume, with the server crashing at some point due to out of space errors. Another time I was using a local database meant for local caching and again, sometimes it would fully initialize only after my main process was started.
And because I was using ELB with auto-scaling, it meant that these incorrectly started servers would be connected to the load-balancer, because the main process was suddenly responding to /ping, even though it wasn't ready yet. And then it would receive thousands of requests per second per server, at a moment in time in which the cluster badly needed fresh instances, which led to an unstable cluster. But only sometimes ;-)
So no, I shouldn't need to have to "learn to trust the operating system / systemd" on my servers -- it has no reason to be there!
... the one that people who moved away from System 5 rc scripts years ago have been pushing for with some degree of success, for years. systemd is not its source at all. systemd has merely been reaping the benefit of all of the programs over the past 18 years that have gained a --no-fork or a --foreground or a -D or a -F or whatever option in response to those who wanted to run services properly without bodging things under daemontools, or runit, or s6, or perp, or freedt, or daemontools-encore ...
CoreOS has been quite successful in basing their own infrastructure on systemd and with rkt they are moving to use systemd even more.
> Try to find the answer to "which units are going to be started on next boot?".
Isn't this just `ls /etc/systemd/{user,system,network}//*` (bah HN formatting is messing this up)
Also the other states:
> Speaking of which, why is systemctl daemon-reload even a thing?
Because configuration changes while things are running. Otherwise we wouldn't need apache2 reload, nginx reload, haproxy reload, etc. Also, according to the man page:
> After the units have been edited, systemd configuration is reloaded (in a way that is equivalent to daemon-reload).
As for systemctl edit, it allows you to add diffs to the unit file. For example, let's say I am using redis and I want to ensure it always restarts (for whatever reason). Rather than manually editing the unit file (which will have issues if an upstream change happens), I can simply use systemctl edit to add a diff for my change. This way I can still maintain compatibility with the upstream unit file instead of having to deal with potential conflicts. It's not so much babysitting the user as it is a potentially better experience.
Nope.
There are many virtual units for which there are no files. One example is the on-demand getty units. There are two for "plymouth" boot-splash stuff (I see these attempted-and-failed units on archlinux where plymouth never exists). There's some autofs thing. There's auditd.
I'm actually not booted into linux right now so I'm struggling to remember the specifics... but if you also count all the simple mounts and devices which clutter up the output of "systemd --all" as "units which are not files in /etc/systemd" then the count is around 100.
systemctl list-dependenciesI'm not familiar enough with systemd to understand how to trace dependencies and create a complete list of all units that will run at next boot but I expect this to be doable by someone with that expertise.
systemd-analyze dot --order | dot -Tsvg > /tmp/system.svg
The resulting dependency diagram may look complex, but consider that there is no equivalent functionality for SysV init scripts despite the fact that they have the same level of inter-dependent complexity.Linux in the server world is rapidly turning into a thin platform hosting containers (docker, kubernetes, etc) of "fat" Linux distros. Systemd makes a lot more sense if you consider it in that context: a container can use systemd to have the host start a monitoring process whenever any processes are executed, etc. Sure, this probably could have been grafted on to sysvinit, but it would have been an ugly hack just like every other thing that's been grafted on to sysvinit.
Linux everywhere else but the server world is all about low power usage and tight integration with custom hardware. Embedded devices, mobile phones, tablets, wearables, etc. All of these use cases demand an init system that is aware of and able to manage the system power state as a gradient, not a binary value. Again, this could probably be hacked on to sysvinit or the kernel itself, but would require big kernel changes and likely a fork for "Mobile Linux" and "Server Linux" as the market begins to demand power-aware schedulers, memory mappers, etc.
If the computing world were to remain in a paradigm where we run small physical or virtual servers dedicated to tasks, then sysvinit would be fine. But that's not where we are today nor where we will be, and sysvinit simply isn't flexible enough for a lot of the use cases where Linux is seen today. The *BSDs exist if you want a rock-solid and simple x86 Unix system for hosting traditional applications in a client-server setup; but if you want a flexible platform for building arbitrary products, Linux is the way to go.
LOL no. distro maintainers wanted to ship gnome, which was product tied to systemd. No systemd, no gnome, that simple.
https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=1729;bug=7...
https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530
For what is worth, all the Debian maintainers I know, even those who are not systemd supporters, felt that sysvinit had to go in a way or the other (eg. during the default init debate the options were systemd and Upstart, sysvint was doomed to be replaced and only kept as a compatibility option in any case.)
With systemd, you do the exact same thing and then call systemctl reload daemon. Is the author making an argument here based some other distributions way of handling System V?
"At least the most vocal crowd". Which means that most people DO NOT CARE, and the systemd war is beyond ridiculous.
As Linus said, > "I don't actually have any particularly strong opinions on systemd itself."
I don't hate systemd. I like what it's trying to do, and I don't hate the big-picture implementation either. But I, and many others, have a bunch of concerns around some specific details of the system, that got ignored and swept under the rug in the tide of vitriol between the two sides of the "war".
If the discussion had been more civil, maybe the more rational objections might have got heard, and we might have been able to pressure Lennart and Kay into not rolling their own, un-reviewed, crypto for journald[0]. We might have been able to avoid some of the feature-creep[1] that seems to have grown out of a NIH-mentality, and a better relationship with the community might have made the core developers more willing to play nicely with others[2][3].
0: http://lwn.net/Articles/512895/ 1: http://www.freedesktop.org/software/systemd/man/systemd-reso... 2: https://bugs.freedesktop.org/show_bug.cgi?id=76935 3: https://bugzilla.redhat.com/show_bug.cgi?id=1116651
I mean, it's not my standard usecase in this moment of my life, but I see how it can be useful.
(Also, your last link reports that "This bug is for livecd-tools which has been fixed", I don't know what's the point you're trying to make.)
Oh, so if an nfs mount fails on boot, it's not going to just sit there and hang? I guess that's pretty cool, saves me from having to throw a console on it while muttering under my breath. And it didn't start nginx either, so it's not going to serve a half broken site and tell the loadbalancer all is good? Maybe it's not all that bad. No no, what am I thinking, this is still crap, I could've written all this in to the init scripts (but I didn't).
This client's service is irritatingly unreliable, maybe I should write a wrapper to supervise it. Someone must have done something like this for syst... Restart=OnFailure... well that's nifty.
Ugh, monitoring daemon ate up all the memory again, why can't the vendor get their shit together or the client switch to something that isn't useless. Guess I'll google some ideas for a watchdog script. Hmm, looks like I can just throw MemoryLimit and Restart=onfailure in the unit? No way it's that easy. (it was)
After a couple months of this, systemd actually started to seem useful, I even started having a little bit of dread when hopping on an older server and having to deal with openrc. All of the complaints here really seem off base to me now that I've had a chunk of time to figure it out. Init scripts pissed me off when I didn't have much experience with them too. Now, thats not to say I like everything about the systemd switch. netctl is utterly worthless for anything other than a static ipv4 address (and reenable, really?). I still forward all my logs to syslog, because I prefer text files (and all the awk/sed/grep/cut/sort/column/etc goodness that comes with them) for anything more than running `systemctl status <service>` and seeing that I accidentally the config file for something.
I also don't buy the whole "It should be on desktops, not servers" because I don't see much of an advantage for desktops, other than maybe the trivially faster boots. Wifi is a pain in the ass with netctl and netctl doesn't seem play well with anything else. But for servers, I've found it to be pretty awesome.
To address a few things straight from the article that I disagree with:
>At least one Debian package (memcached) is already invoking a wrapper script from ExecStart.
This is exactly why I don't understand the whole argument around it being inflexible. If you need to call a script that does some setup that's incompatible with systemd, call the script? It's no different from helper scripts that many packages used with init scripts. If you still want to do some checks and call start-stop-daemon, go right ahead, nothing is stopping you. It seems pretty strange to consider it a fault that you can't use a bash script, and then complain that you'll have to use a bash script.
>Here, let me helpfully tell you that you should run systemctl daemon-reload, but perform the action you requested using the old configuration anyway.
This really seems like a trivial complaint. I guess you could always alias systemctl="systemctl daemon-reload; systemctl" if it's that much of an issue. Personally it's saved me after an accidental :wq (damn that muscle memory). "File has changed on disk" uhhh it shouldn't have. crap. I guess it's a matter of preference. Also I didn't even know systemctl edit was a thing. That does seem kinda pointless, but it also seems kinda pointless to be bent out of shape over it. Do you also cat `* * * * * command >> /var/spool/cron/crontabs/$USER` because crontab -e is babysitting you? (I used to do that, but because e and r are too close together and reconstructing a crontab from logs is painful. Now I just alias crontab="crontab -l; crontab")
>Now, systemd does rely heavily on D-Bus
I've never run into issues with it, but I do agree with you on that point from a philosophical standpoint.
>And yes, you can avoid the whole issue just by masking any units you don't want to start, but that's missing the point.
The only point I see is that it's different. Of course whatever you're used to is going to be more effecient to you than something new.
>I believe it creates more problems than it solves. Sadly, many of those problems will take years to become apparent, by which time all the major Linux distributions will have fully integrated it.
Well it definitely seems to solve more problems for me than it creates, and saying those problems will only be apparent years down the road is not only impossible to argue against, it's a hand wavy cop out of "Trust me, its just bad! Because reasons!" However this does touch on what is probably my biggest gripe with systemd, and that is that ALL the big distros seem to be switching. Granted I don't mind from a having-to-use-it angle, since I personally prefer it and would probably stick with distros that do anyways, but it does give me a certain unease, it may be my choice but it shouldn't be the only one, and I'd have the same problem if it was sysv that everyone switched to.
All in all, these complaints really just seem like complaining that it's different. And it is different, but that doesn't necessarily make it better or worse, just takes time to get used to.
People have had whole boxes fail to come up because of a NFS mount that didn't work, and therefore the unit file didn't come up roses, and so systemd decided to abandon ship and present the admin with a borked minimal console.
One early fix, a brute force 30 second kill timer on every unit file.
Went over well with one Fedora Alpha (lucky for them) where said timer tripped on the post distro upgrade house cleaning unit.
This rant is a good example how luddite users rather stay stuck in a UNIX System V world with their green phosphor VT100 terminals.
Meaning that it could accomodate both the latest and "greatest" coming out of the labs, and the tried and tested stuff that had been sitting in production for a decade.
systemd instead gloops it all into a lightly coupled shoggoth of a project that is chasing the future come hell or high water.
Those kinds of people will always exist - they've spent many hours learning it the good old hard way, and I'm damned if you kids are going to make it any easier! You lazy so-and-sos.
http://www.steven-mcdonald.id.au/ugly.shtml :D He should still ditch the yellow though.
(But, yeah.)
It simply changes all colors so that text is black-on-white, but leaves everything else unchanged.
Font sizes, poorly sized and laid-out pages, overlapping divs and other elements, animiations....
Readability fixes most of that quickly.
The metric I like to use for adopting new processes / services is pretty simple. I have _____ problem. What tool solves that problem for me.
In my case systemd solves nothing and creates more.
I seem to recall the same line being used about (GNU/)Linux at one point.
I actually prefer from-source package installs because I get a higher degree of control over configuration options.
Yeah, newcomers to the Linux land without the expertise you guys acquired through 10 years of using Linux, would apparently appreciate how easy it is to manage a server by invoking some lengthy commands they learned through reading the often overly-dense manual instead of `systemctl start/stop x`.
Nowadays some of those so-called "hackers" tend to ignore the part of work that makes the user experience better. They claim that they want simplicity and avoid bloat but most of the times they are just being lazy and not sympathetic to their users.
I'm not saying that things should be dumbed down to clicking GUI buttons on Linux. But if you want your program to become mainstream you need to think about providing good and practical docs and making your program easier to use, even for text-based programs.
Accept that most people would like Bootstrap'ed sites more than yours:
body
{
background-color: #080808;
color: #ffff70;
font-family: sans;
}
That's why I opt for Ubuntu 15.04 instead of 14.04 LTS on my VPS, since 15.04 has systemd.Can I use Lennart's inability to buy a properly sized polo as a reason why systemd is bad?
Yeah. The guy has an ugly website. But he has specific points about mistakes that systemd didn't learn from and is repeating. Did he list 'it's too user friendly' as one of those mistakes? In fact, one of his core arguments is that there will actually be an increase in complexity and reduction in user friendliness due to design choices that have been made.
My comment is not about design choices but attitude and sympathy to users. This is not intended as an ad-hominem.
The author seems to think systemd "babysits" its users, but as a user I find systemd "cares" about its users.
It might not look fancy, but the readability is way better then on most sites these days. It loads fast, it has enough contrast, there are no distracting elements like images or animations that make it hard to focus on the content, scroll works as expected, the content is not split into useless pages, it does not make my fan spin up because some elements use insane amounts of computation power, content is not squeezed into some tiny box as it often is on other websites...
If the average website would let me read as comfortably as this one, that would be a huge step forward.
2. The author doesn't dislike systemd.
But it's really great to have a page that loads nearly instantly - the ratio of information provided : loading time is very good.
Other pages take an age to load (and Chrome on iOS has an annoying "feature" where the address can't be selected and copied until the page has almost finished loading).
See theverge.com for an example of a site that doesn't even scroll smooothly on my android phone.