News for hackers. Stuff that matters.
Re:Why systemd is winning the init wars and other things aren't by exDM69 on Wednesday February 12, 2014 @03:06AM (#7223143)
> This accusation presupposes that a change was necessary or desired in the first place. Sorry, no, some of these things should not be tied together. Without that tying, we already have (known, tested) tools that cover most of these features.

This is the argument we've heard over and over again.

The problem with traditional unix init scripts, together with cron, acpid, inetd, etc is that you need a big brittle mess of shell scripts to tie it all together to form a system that actually works.

While the traditional approach may work alright for a static setup like a server that is booted once and stays on forever, it's not good enough for a desktop, laptop or mobile device. There may be changes in power (mains/battery/low power), network connectivity (ethernet, wifi, mobile) and connecting peripherals (including external disks) and lots of other things which need starting/stopping services or mounting/unmounting partitions. The amount of shell script glue to make these things work is unwieldy and doesn't really work that well.

And distribution maintainers have to make a choice, supporting more than one init system is going to be a burden that will hurt end users in the long run.

Finally, no one is forcing you to use a systemd based distribution. If OpenRC solves your problems, do go ahead and use Gentoo or another OpenRC based system.

Re:Why systemd is winning the init wars and other things aren't by pdkl95 on Wednesday February 12, 2014 @05:28AM (#7223544)
I am not seeing any justification for why these tools HAVE to be a single, monolithic tool.

> script glue

That's what shell scripts[1] are FOR - they are the minimal glue that binds the large applications together. Besides, "big brittle mess" is a matter of opinion. Are you trying to tell me that this OpenRC script is a "mess" that needs to be replaced, taken from /etc/init.d/cupsd my current desktop:

    #!/sbin/runscript
    depend() {
        use net
        need dbus
        before nfs
        after logger
    }
    start() {
        ebegin "Starting cupsd"
        checkpath -q -d -m 0755 -o root:lp /run/cups
        checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
        start-stop-daemon --start --quiet --exec /usr/sbin/cupsd
        eend $?
    }
    stop() {
        ebegin "Stopping cupsd"
        start-stop-daemon --stop --quiet --exec /usr/sbin/cupsd
        eend $?
    }
Yes, some scripts get much longer, because they have more complicated needs. Even in an alternate environment such as systemd, those will always be complicated.

Things like changes in power or network addresses have been handled by OpenRC just fine (note: that was opinion, and systemd is better in some cases). More important,y those requirements do not suggest a need to bind tools together into one package, thoug; instead, they suggest a well-defined API* (or ABI) is needed. In OpenRC, that is simply another runlevel that you trigger on power-plug changes, etc.

Your argument seems to be that the using many tools is too complex (even though each tool in isolation is much simpler, reduced in scope, and is likely to have fewer bugs), while tying that functionality together is faster to develop (despite makng the problems into a complex, interdependent mess). Despite being labeled an "april fools joke", RFC 1925 [2] has important wisdom. In particular, there seem to be a lot of people ignoring Truth #5:

    It is always possible to agglutinate multiple separate problems
    into a single complex interdependent solution. In most cases
    this is a bad idea.
This is really a restatement of the UNIX design philosophy. Or maybe you're prefer this version, written by some old hackers you may have heard of[3]

    Even though the UNIX system introduces a number of innovative programs and
    techniques, no single program or idea makes it work well. Instead, what makes
    it effective is the approach to programming, a philosophy of using the computer.
    Although that philosophy can't be written down in a single sentence, at its heart
    is the idea that the power of a system comes more from the relationships among
    programs than from the programs themselves. Many UNIX programs do quite trivial
    things in isolation, but, combined with other programs, become general and useful
    tools.
This idea about keeping problems separated was true when those guys wrote UNIX in the first place, it was true wen Dijkstra suggested structured programming instead of "goto", it was true when Alan Kay suggested sending Messages between Objects for yet more encapsulation, and countless other examples throughout the history of software. It is still true now.

If you're having a hard time seeing this, I suggest you re-examine the problem and ask if an API could tie the pieces together, because it probably already exist in an unspecified form.

> Finally, no one is forcing you to use a systemd based distribution.

Of course not, but the monopolistic tactics being used to vertically integrate systemd IS forcing a problem - on purpose - with various other tools such as udev and gnome.

I'm obviously going to stick to Gentoo for desktop use, but even there, the disruption caused by systemd has caused a significant mess by breaking previously-working software on purpose.

--

1: If this is merely a hatred of BourneShell/BASH, I would actually understand that as it certainly has its layers of cruft and gotcha/wtf behavior. A new Little Language[4] with special support so the standard "init script" support to make the scripts trivially small in general case could be really nice.

2: http://www.ietf.org/rfc/rfc3439.txt

3: Brian W. Kernighan, Rob Pike, "The UNIX Programming Environment"

4: http://c2.com/cgi/wiki?LittleLanguage

Re:Why systemd is winning the init wars and other things aren't by hactually on Wednesday February 12, 2014 @06:35AM (#7223759)
So my cups.service is:

  [Unit]
  Description=CUPS Printing Service


  [Service]
  ExecStart=/usr/sbin/cupsd -f
  PrivateTmp=true
  
  [Install]
  Also=cups.socket cups.path
  WantedBy=printer.target
It requires no extra things - Your cups script depends on checkpath and start-stop-daemon. More executables, more dependencies so yeah, I'd argue it suffers coupling and is a mess. You say that systemd makes things a "complex, interdependent mess" but it's better than the brittle dependent mess of the status quo. The usage of start-stop-daemon doesn't even ensure that the app was killed - it acts just as a killall <servicename>. It doesn't catch a process in a Disk Wait state or even if the process has trapped the SIGTERM - It's not just useless, it's deceptive as to its functionality.

People continually spew the line about the UNIX philosophy. If you want to use Unix, use Unix.

Linux is [becoming] better than Unix.

Re:Why systemd is winning the init wars and other things aren't by nailer on Wednesday February 12, 2014 @07:16AM (#7223869)
The other super awesome thing about systemd is: all errors and output from this service is captured by journald with 'cupsd' as the source.

Compare this to SysV init, where you have to manually wrap stuff in syslog calls (and the facility names are 'uucp' and 'news' rather than anything meaningful). <3

Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @06:12AM (#7223690)
To your openrc example: How do you statically determine what state the system is meant to be in this moment? Without doing that, you are unable to determine whether the system is in that state, and so unable to take corrective actions.

Furthermore, how do you even determine whether or not a service is still running? Init can not sanely do that for anything but the simplest cases, and a non-pid-1 process can not do that without the risk of losing the capability when that process dies (it's when, not if when you run more than a handful of servers or vms - when you have aggregate uptimes across a system measured in centuries and individual uptimes on most servers measured in years, it does not matter how robust a component has been written - you will see them fail, not necessarily of their own doing).

And a "new litle language" would not solve the issue unless it is purely declarative. A large part of the point is to be able to reason about system state, in part by being able to tell what the state should be, in part by being able to verify what the state actually is and operate on it (start/stop etc.). The former requires you to be able to statically determine the current intended state; the latter requires you to be able to accurately track which processes forms part of a service, even if the parent daemon dies and orphans a bunch of stuff (and in that case it is not helpful if the process trying to do this can die and orphan everything and lose the state information).

Re:Why systemd is winning the init wars and other things aren't by jude- on Thursday February 13, 2014 @04:18AM (#7230349)
I'm pretty sure openrc uses (or has the option to use) cgroups for dealing with just this. Containerizing services isn't a new idea--Solaris and FreeBSD can do this already, for example.

Regardless of the init system, we've had the ability to control daemons with cgroups already for some time (cgexec and friends). Even in humble sysvinit, I can edit an initscript and ensure that the service it starts runs in a cgroup. Hypothetically, I could even do this inside of start-stop-daemon.

Re:Why systemd is winning the init wars and other things aren't by CrLf on Wednesday February 12, 2014 @03:47AM (#7223238)
"While the traditional approach may work alright for a static setup like a server that is booted once and stays on forever, it's not good enough for a desktop, laptop or mobile device."

Sorry for sounding like a troll, but what you're saying is that the traditional approach works alright for setups where unix is actually good, and doesn't for setups where unix is actually crap.

Lets exclude mobile devices from this picture (because those don't use general purpose Linux distributions and arguably don't use unix at all, but a unix-kernel with specialized - non-unix - userspace) and concentrate on servers and desktops/laptops...

This systemd rage shows exactly why it's 2014 and while Linux is extensively used and trusted on the server side, it continues to limp along on peoples' desktops: it constantly reinvents the wheel (badly) with monolithic pieces of bloatware that are usually throw away tried-and-true solutions for unproven experiments. It throws away the old way of doing one thing and do it well in favor of components that do too much and become so complex that troubleshooting is a nightmare, exactly the kind of complaints we have about non-unix systems...

Need an example? Where are the people that used to criticize the Windows registry now? I just recently almost(1) had to throw away my entire home dir on Ubuntu just to try and reset Kontact, because in this day and age the configuration structure of this stuff is far worse, and it's almost impossible to separate one component's configuration files and folders from everything else. And I'm not even going to start ranting about how in the name of $DEITY a mail/calendar application needs MySQL running in the background and about there is not a single decent mail client for Linux right now. Mail... a decades-old problem!

I don't object to systemd itself, but I do object to systemd invading my servers that work just fine without it.

(1) "Almost" because I just learned to live with the occasional crashes and misbehavior caused by some pieces of old configuration still lingering somewhere.

Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @04:13AM (#7223307)
As someone responsible for dozens of servers and 100+ vm's: The "tried-and-true" init solution is utter shit. It's duct-tape and band aid.

The current init solution does too much. Not in initd, but in the massive mess of scripts piled on top of it to get a working system.

Re:Why systemd is winning the init wars and other things aren't by d0 on Wednesday February 12, 2014 @04:59AM (#7223450)
You might want to take a look at FreeBSD's init and process management stuff. It's very clean, tidy, well engineered and doesn't involve sysvinit.
Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @05:15AM (#7223498)
Or I just use systemd. My interest in getting rid of sysv init is less work, not having to to spend time dealing with an init system not supported by the Linux distro's we depend on.

Doesn't matter if FreeBSD's solution is better or cleaner or both, I'm afraid.

Re:Why systemd is winning the init wars and other things aren't by synchronise on Wednesday February 12, 2014 @05:28AM (#7223546)
I think he was suggesting you try out FreeBSD, which I also recommend.

It's a solid server environment.

Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @05:31AM (#7223550)
I have, but I have no reasons whatsoever to consider a switch - the potential upside is way too small to be worthwhile.
Re:Why systemd is winning the init wars and other things aren't by synchronise on Wednesday February 12, 2014 @05:38AM (#7223572)
Why?
Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @06:00AM (#7223651)
Because the potential upside is tiny. There's nothing in FreeBSD that I can't get in Linux that I have any particular need for. I'm sure there are features that are important and valuable to other people, but that doesn't help me.

That leaves near 0 benefit, and some unknown non-zero cost and risk associated with reduced experience with it, potential application incompatibilities and other unknowns, as well as a time cost of re-imaging servers and re-deploying vm's that would put tens of thousands on the cost side.

That's not exactly a cost-benefit situation that justifies spending time considering it.

If the FreeBSD guys develop something so amazingly much better than Linux that we could save lots of money by switching, that could change. I don't see that as very likely, though.

As it is, FreeBSD vs Linux is a bit like Coke vs Pepsi: If you have a preference, and its available, pick it, but it makes very little sense to expend lots of effort to replace one with the other.

Re:Why systemd is winning the init wars and other things aren't by teacup50 on Wednesday February 12, 2014 @08:22AM (#7224068)
In FreeBSD land, nobody wastes eons of time hacking out bad code experiments like systemd and then arguing between themselves on whether to distribute them.

It's a stable system you can rely on, year by year. That's not a small upside for a server platform.

Re:Why systemd is winning the init wars and other things aren't by d0 on Wednesday February 12, 2014 @08:38AM (#7224137)
This is precisely why I recently trashed my last few Linux machines and moved them over to FreeBSD. Well to be honest it was because it's absolutely tiresome not having a cohesive well documented system to rely on without the politics and collection of dickhead advocates and pseudo-religious leaders around my ass like mosquitos. Oh and ZFS, MAC, audit, decent ACL support, binary upgrades etc.

However I agree that there is little motivation to move if what you have works. I did mine during a hardware refresh.

Re:Why systemd is winning the init wars and other things aren't by hactually on Wednesday February 12, 2014 @03:56AM (#7223260)
> I don't object to systemd itself, but I do object to systemd invading my servers that work just fine without it.

I think the Lennart and the Red Hat engineering team have more important things to do than covertly install systemd on your server. Please quit with the hyperbole.

Re:Why systemd is winning the init wars and other things aren't by theBlackDragon on Wednesday February 12, 2014 @05:56AM (#7223633)
And there you exactly pinpoint the problem. The FLOSS movement used to be about caring about other people and projects. RedHat* and its employees only give a damn about their use-cases and the rest of the "community" can go to hell.

Which, of course is a logical stance to take for any corporation, however how easily everyone goes along with it is just appalling.

*this, of course, goes for every corporate entity, though some work with the community better than others.

Re:Why systemd is winning the init wars and other things aren't by hactually on Wednesday February 12, 2014 @06:22AM (#7223730)
How have I pinpointed the problem? I'm sorry - are you arguing that the RH guys should be covertly installing systemd in the parent posts servers?
Re:Why systemd is winning the init wars and other things aren't by Xylakant on Wednesday February 12, 2014 @08:00AM (#7223990)
> The FLOSS movement used to be about caring about other people and projects.

Was it? I thought the primary driver was "I had a problem, this is the fix for my problem, maybe it helps you. I share this solution, you share yours.". Which basically holds true nowadays: Systemd solves Redhats problems. If it solves enough problems for enough people then it will prevail and other people might enhance it to fix their problems as well if they deem it a viable foundation. If it doesn't, then systemd will remain a niche solution that fixes redhats problems - which would totally be fine with me.

Given that we have the discussion on the debian list I'm inclined to believe that at least enough people think systemd is it to give it a push. If you don't like it stick with what you like or roll your own, but don't bitch and moan about redhat building a software that suits their use-case primarily and giving it away for free.

Re:Why systemd is winning the init wars and other things aren't by sparkie on Wednesday February 12, 2014 @10:16AM (#7224705)
It would be nice if that held true. The problem isn't that RedHat developed a solution for their own problem, it's that their crowd are incredibly vocal about other people adopting it, even to the point of verbal attacks and attempted character assassinations against people who disagree with their stated aims. And of course, they will never admit publicly that systemd is developed to solve RedHat's problems, but will try to convince people that they have more noble aims, to solve the problems of the wider community. It's rhetoric. If they just dumped the software and let it's technical qualities speak for themselves, there wouldn't be so much drama.
Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @06:56AM (#7223819)
Everyone "goes along with it" because they've evaluated it and decided it fits their uses cases too.

Redhat does not have the power to force anyone to adopt systemd.

Re:Why systemd is winning the init wars and other things aren't by theBlackDragon on Wednesday February 12, 2014 @11:15AM (#7225097)
And yet they do. They pay enough developers working on enough big projects to have the power to force adoption (not to mention the sponsoring of various other things, like infrastructure). By making it a hard dependency of Gnome for example (which in itself has turned into a 3rd-party developer hostile project, but that is another discussion entirely, but if you care, go read IgnorantGuru's bloggins)

So they're using end-user pressure (no systemd = no Gnome) to force adoption.

Re:Why systemd is winning the init wars and other things aren't by synchronise on Wednesday February 12, 2014 @03:25AM (#7223187)
You're forgetting the traction that OpenRC has gained in the past year, they have already implemented cgroup support and experimental process tracking and it's moving beyond simple shell scripts.

It doesn't have feature parity with systemd, but it has portability and it's more permissively licensed, and factoring the speed of development I anticipate that it has a bright future ahead of it.

Re:Why systemd is winning the init wars and other things aren't by cynicalkane on Wednesday February 12, 2014 @03:34AM (#7223208)
Not to devalue systemd, but I suspect that a lot of Unix problems could be solved if Unix offered a better general-purpose solution for gluing things together other than "big brittle masses of shell scripts". In particular, shell itself is an ugly mess of weird syntax, gotchas, and corner cases.
Re:Why systemd is winning the init wars and other things aren't by CrLf on Wednesday February 12, 2014 @03:54AM (#7223255)
Granted, init-related scripts have become complex along the years, but we may argue that happened because of the same type of reasoning that's now justifying the move to systemd: the need to do everything in one place and automagically.

You know, even if I would agree with you that "shell itself is an ugly mess of weird syntax, gotchas, and corner cases" that doesn't preclude init scripts from being redone in something other than shell.

"People who don't understand unix are bound to reinvent it, badly."

This has become the tag line for Linux, and unfortunately is starting to reach the previously sacred grounds of basic (server) infrastructure.

Re:Why systemd is winning the init wars and other things aren't by vidarh on Wednesday February 12, 2014 @04:24AM (#7223338)
The problem is not that they're shell scripts. The problem is that they are not constrained in a way that makes it possible to parse them easily and know what the state of the system is expected to be before and after processing.

Instead you're forced to blindly execute them, and hope the script handles all the appropriate corner cases. In 20 years of maintaining Linux servers, it rarely goes more than days between situations where I come across init scripts that fails to account for some situation in ways that causes me aggravation.

It's not uncommon to come across init scripts that regularly fails to stop a service because it has no proper way of determining which pid the process has, for example.

Just the other day I had to deal with a server where the init scripts happily let 3 instances of a server process trying to operate on the same dataset; thankfully the app locked the files in questions and were just screeming bloody murder in its logs, but they were also all three competing for various resources. The init system of course had absolutely no way of telling that something had gone wrong.

The only solution to have a sane server setup with SysV-init is to not use it for anything but the basic tasks and to start a proper process monitor. Then I'd rather just get rid of init entirely, since you're pulling in a bunch of other code that can do almost all of init's tasks anyway.

Re:Why systemd is winning the init wars and other things aren't by FooBarWidget on Wednesday February 12, 2014 @04:26AM (#7223346)
I argue that shell scripts became more complicated because of quite the opposite of what you're claiming. The original Bourne shell already supported, piping, control structures, etc. So people thought, hey, why design a new init system that does everything properly when we can just push all this logic to shell scripts and have them act as glue?

It's the perfect example of "worse is better". They chose to keep the core init system simple, but as a result everything else became a complicated mess that doesn't handle corner cases properly. vidarh's comment is spot on.

Re:Why systemd is winning the init wars and other things aren't by simcop2387 on Wednesday February 12, 2014 @11:20AM (#7225138)
Towards the idea that you can write them in another language, we in the Perl community ended up developing something of that nature[1]. It was originally intended to make writing daemons in Perl easier by pulling out common functionality (double fork and such), and giving a consistent clean interface. One of the bigger requested things was the ability to use it as basically the entire init script ([2] for an example).

[1] https://metacpan.org/pod/Daemon::Control [2] http://hashbang.ca/2012/04/16/wherein-i-realize-the-bliss-of...

Re:Why systemd is winning the init wars and other things aren't by adobriyan on Wednesday February 12, 2014 @04:48AM (#7223425)
> In particular, shell itself is an ugly mess of weird syntax, gotchas, and corner cases.

Just like C! (syntax is mostly OK though).

This is not coincidence.

If your modus operandi is "works 95% of the time" then you end up with C, shell and sysvinit collectively known as Unix.

Re:Why systemd is winning the init wars and other things aren't by riquito on Wednesday February 12, 2014 @06:17AM (#7223706)
Years passed and we discovered a bunch of things. Everyone agree that Bash syntax could be better, and C is not perfect either (that's why new languages like Rust are being developed). We didn't reach perfection a couple decades ago, so if someone want to try and replace the good old tools, I say "go on!": it would be exciting to see something better.
Re:Why systemd is winning the init wars and other things aren't by rodgerd on Wednesday February 12, 2014 @04:28AM (#7223354)
> While the traditional approach may work alright for a static setup like a server that is booted once and stays on forever,

Actually, it's not. Unless the server also has no dynamic resources and nothing in userland ever changes.