The theory of relativity in words of four letters or less - <AUTHOR> http://www.muppetlabs.com/~breadbox/txt/al.html <comment><USER2> >Say you woke up one day and your bed was gone. Your room, too. Gone. It's all gone. You wake up in an inky void. Not even a star. Okay, yes, it's a dumb idea, but just go with it. Now say you want to know if you move or not. Are you held fast in one spot? Or do you, say, list off to the left some? What I want to ask you is: Can you find out? Hell no. You can see that, sure. You don't need me to tell you. To move, you have to move to or away from ... well, from what? You'd have to say that you don't even get to use a word like "move" when you are the only body in that void.

This is not as self-evident as the author believes.

1\. Having taught a great many college level physics students, they have trouble grasping this.

2\. More importantly, there's a _reason_ people pursued the theory of the aether for so long -- you have to actually do the fucking experiments to show that there's no absolute reference frame you could be said to be moving in. Thinking that you can deduce physical facts about the universe _a priori_ is the opposite of science.

 _e:_ Suddenly remembered a Feynman bit from _Lectures_ where he talks about _exactly_ the attitude of treating this is somehow obvious: [http://www.sciencechatforum.com/viewtopic.php?f=10&t=207...](http://www.sciencechatforum.com/viewtopic.php?f=10&t=20750)

<comment><USER3> Exactly my thought reading that. That question, "Can you find out? Hell no," _is_ relativity in a nutshell. If you really grasp what that means, the whole deal from simultaneity to time dilation to curved spacetime all falls out more or less intuitively. (Of course it was harder to work out the _first_ time :P)

Most people implicitly believe that there _must_ be some privileged reference frame, if not _mine_ necessarily than at least one very close to mine, and for good reason. (I'd go so far as to say that most people believe _explicitly_ that there is a privileged reference frame, and that it is an intelligent agent called God, but leave that alone for now.) Even if they do get past this statement with a, "Uh, okay, I guess so..." they probably have not actually adjusted their entire world view to account for that powerful fact, and if they seem to understand what you have told them it is likely that they have simply memorized the right answer.

Not that there's anything wrong with trying.

<comment><USER4> > I'd go so far as to say that most people believe explicitly that there is a > privileged reference frame, and that it is an intelligent agent called God

????? Why do you assume God is a physical being inside the universe? (Do people really think that?) God created the universe - God is outside it. Like God is the computer and the universe is the program.

God isn't at rest/not at rest. The concept doesn't even apply.

<comment><USER5> Most people do not think it through that way. They probably don't think God is a physical being, and they probably don't have a very specific idea about his location, but they definitely think he is viewing the universe, wherever he is.

<comment><USER4> Fine, but if he's viewing the universe he is not inside the universe - i.e. he doesn't have a reference frame.

<comment><USER5> This is your assertion, not theirs.

</comment></comment></comment></comment></comment></comment><comment><USER6> Interesting read and I like the concept, but I think the 4-letter rule added an arbitrary constraint that didn't necessarily make it easier to read or understand.

If the idea was "explain relativity simply" then it could have been done better -- word complexity (ie "reading level") is a better measure than outright word length.

If the idea was simply to see if it could be done with 4-letter words, well, mission accomplished :)

<comment><USER7> It was in fact the latter.

(I was inspired in part by Douglas Hofstadter, who did something similar on a smaller scale in "Le Ton Beau de Marot".)

<comment><USER8> Sounds very similar to Guy Steel's "Growing a Language" talk. His constraint was to not use any word greater than one syllable unless it is defined by either one-syllable words, or other words that had been previously defined.

<comment><USER9> That really is a great talk! It's on Youtube too: <http://www.youtube.com/watch?v=_ahvzDzKdB0>

</comment></comment></comment></comment><comment><USER9> The Up-Goer Five Text Editor is a pretty great resource with similar constraints: "Can you describe a topic using only the thousand most common English words?"

The results in their Hall of Fame are fascinating. It's inspired by the xkcd linked elsewhere in this thread.

<http://splasho.com/upgoer5/halloffame.php>

</comment><comment><USER10> I found that four letters added some ambiguity and some uneeded complexity. Maybe 5 or even 6 letters?

Still, this is a great intro to relativity and it was a fun read. Also a cool literary feat.

<comment><USER11> I find the fuzzing of proper names gets annoying, and it would be better if the rule were relaxed for proper names.

<comment><USER12> Personally, I found the abbreviated names made the piece even more hilariously irreverent than it already was. "Izzy" for Isaac Newton? Makes him sound like an 1980's heavy metal star or something.

</comment></comment></comment><comment><USER13> This is phenomenal, does anyone have sources of more physics concepts explained simply?

Scott Aaronson's Quantum Physics is one: <http://www.scottaaronson.com/democritus/lec9.html>

<comment><USER14> Obligatory xkcd: <http://xkcd.com/1133/>

<comment><USER15> I want to point out that xkcd's criteria for usable words is a lot better than "four letters or less". There are some really obscure, yet very dense words out there.

</comment></comment></comment><comment><USER16> I know I'm dumb, but can someone explain this part?

"Dana sees each rock at the same time, but Bert sees one rock and then sees the next rock."

How would anyone's movement, or lack of it, affect their perception of whether the rocks landed at the same time or not?

<comment><AUTHOR> The rays that come from each rock move only so fast. They take time to get from the rock to Dana or Bert. And it is only by when those rays get to Dana or Bert that they can say if they were at the same time, or one and then the next.

Now. Bert is on the bus. It goes, let us say, from west to east on the road. Bert is half way from the west rock to the east rock when each rock hits land -- but he is on the move, and when the rays from the east rock hit his eyes he has gone some way east. The rays from the west rock have not yet got to him. Then, just a tad more time, and the rays from the west rock get to Bert's eyes.

But Dana does not move. She sits by the road. The rays from the west rock and the east rock hit her at the same time: each rock is, say, a yard from her, one west and one east.

So Dana sits and does not move; she sees the rays from each rock at the same time. Bert is on the bus, and goes from west to east; he sees the rays from the east rock and then the rays from the west rock.

And all that is fine. They both know that Dana does not move and Bert does. So they will say that each rock hit at the same time, for Dana (who did not move) saw them hit at the same time.

But (and this is the bit that may fry your mind) we can just as well say that Bert does not move and Dana does move! And then we will have to say that the east rock hit and _then_ the west rock! How can that be?

We must say, even if you find it odd, that "did the east rock hit, then the west? or the west, then the east? or both at once?" just goes one way for Dana and not that way for Bert. Just like "is this rock to the east or to the west?" may not go the same way for both, if they are not at the same site.

(You are not dumb. This is hard. It took Al to work it out!)

<comment><USER7> Yes, you have the idea. You put down just a word or two, no more. But then you add to it, and then some more, and then the next you know, you have a page full of such text. It can be hard to stop once you get into it!

</comment></comment></comment><comment><USER17> Age restricted as inappropriate by UK filters, presumably because it contains "four letter words". Great one O2. Nothing like restricting access by our kids to educational material.

<comment><USER18> It may be qualifying "she's on her ass" as inappropriate.

</comment></comment><comment><USER19> This is cool. I felt I had to keep my note the same. A very neat idea I'd say. Wish it was more easy to read. Very cool!

<comment><USER20> I see what you did here. I had the same idea, but you beat me to it.

</comment></comment><comment><USER21> Now who can describe the theory of relativity in only four words?

Similar to this: <http://www.wired.com/wired/archive/14.11/sixwords.html>

<comment><USER7> Everything's relative except _c_.

Best I could do.

</comment></comment><comment><USER22> I made a word cloud of this

I removed "and", "you", "the", "that", "a", and "to" as those were just a bit TOO big.

<http://i.imgur.com/77V6OvQ.png>

<comment><USER23> Al?

<comment><USER22> ALbert Einstein. I think.

</comment></comment></comment><comment><USER24> Any one of us can work out x by x plus y by y plus z by z less c by t by t where x and y and z and t are each part of how to get from one "here and now" to a 2nd "here and now". I can try to tell you what c is or we can just say that it is one (i.e. c by t by t is just t by t). And the math that we do will work out the same if I work it out from what I see or if you work it out from what you see, even if I do not move at the same rate as you.

</comment><comment><USER25> Reminds me of the story behind "The Cat in the Hat."

"In May 1954, Life magazine published a report on illiteracy among school children, which concluded that children were not learning to read because their books were boring. Accordingly, William Ellsworth Spaulding, the director of the education division at Houghton Mifflin who later became its Chairman, compiled a list of 348 words he felt were important for first- graders to recognize and asked Geisel to cut the list to 250 words and write a book using only those words. [33] Spaulding challenged Geisel to "bring back a book children can't put down." [34] Nine months later, Geisel, using 236 of the words given to him, completed The Cat in the Hat. It retained the drawing style, verse rhythms, and all the imaginative power of Geisel's earlier works, but because of its simplified vocabulary, it could be read by beginning readers."

From: <http://en.m.wikipedia.org/wiki/Dr._Seuss>

</comment><comment><USER26> I've stumbled upon Brian's website before and have enjoyed many a writeup, including this one.

I recall particularly enjoying `A Monovocalic Sonnet on Dante's "Inferno"` (<http://www.muppetlabs.com/~breadbox/txt/infirni.html>) - the essence/joy being in the Notes section: <http://www.muppetlabs.com/~breadbox/txt/infirni- notes.html> \- it's so random and intense - a true hacker spirit I say :)

</comment><comment><USER27> This reminds me of 'Gödel's Second Incompleteness Theorem Explained in Words of One Syllable'

<https://news.ycombinator.com/item?id=4197284>

</comment><comment><USER28> There's an amusing though mean-spirited article of Paul Samuelson's purporting to debunk the use of the Kelly Criterion - [url]www- stat.wharton.upenn.edu/~steele/Courses/434F2005/Context/Kelly%20Resources/Samuelson1979.pdf[/url] (pdf). All the words are one syllable. I find the title rather poetic - "Why we should not make mean log of wealth big though years to act are long".

</comment><comment><USER29> "Make things as simple as possible, but not any simpler" - Einstein. His own book from Dover is an excellent way to get started.

</comment><comment><USER30> I wonder if something like this might be useful if added to Wikipedia's Simple English version of the Theory of Relativity page? That page seems a bit underdone right now.

<https://simple.wikipedia.org/wiki/Theory_of_relativity>

</comment><comment><USER31> There are many interesting pages on this site. The brainf __k and Intercal resources are a fun read, also the tiny executables. The Tile World downloads are a bit out-of-date though.

</comment><comment><USER32> Looking at the page full of short words, the whole text just looks very weird, strange and sometimes just distracting. I never knew that I looked over the page so much as I was reading.

</comment><comment><USER33> I'd prefer "The theory of relativity explained to four years old".. the "four letters or less", although funny, makes it harder to grasp IMHO.

</comment><comment><USER34> I found the article hard to read because of the word length. It created a strange, artificial rhythm to the text that drove me to distraction.

</comment><comment><USER35> As an explanation it's only mediocre, but it was a lovely poetic read. It felt on the verge of lyrical the entire time.

</comment><comment><USER36> Am I being pedantic? That really should be four letters or _fewer_.

<comment><USER7> Yes to both.

</comment></comment><comment><USER37> Why?

</comment><comment><USER38> This article is exactly what I needed, I've been trying to understand the unification of Gravity, Inertia and Centrifugal force for years now, couldn't fathom it, now I can.

The best I can describe it is: "Matter is like water through a drain", I wrote a post with my consolation of how the three can be seen as one:

[http://sentientmachine.blogspot.com/2013/05/matter-is- like-w...](http://sentientmachine.blogspot.com/2013/05/matter-is-like-water- through-drain.html)</comment>


How to Crash Systemd in One Command - <AUTHOR> https://www.agwa.name/blog/post/how_to_crash_systemd_in_one_tweet <comment><USER2> It seems like it is quite fashionable to hate on systemd, and it seems like systemd is kindof a piece of crap - in some ways.

However, linux is missing basic functionality other os's offer, and systemd is showing up and trying to fill in those blanks. This is open source, if you don't like systemd, if you think it's crap, if you think there are obviously better ways to do it, well, what are you waiting for then?

Systemd is winning because they showed up and basically nobody else did. It's open source fork it and 'do it right'. Or point out the problems and hope that someone else will step up instead?

I think the world would better place if people spent less time griping and more time fighting to get their patch that fixes the problems merged. I guess coding is harder than writing blog posts though.

EDIT: I'm not saying systemd is perfect or even good. My point is that the people writing the code are going to have the final say, whether it's right or wrong, and it is unlikely that people writing blog posts lampooning it are really going to make a difference. I mean systemd has been despised and highly criticized from the beginning, and look where we are.

<comment><USER3> The Unix philosophy: Write programs that do one thing and do it well.

Systemd doesn't observe the Unix philosophy and that bothers many people.

<comment><USER4> It's baffling to see people insist that that's the UNIX philosophy when the UNIX philosophy has always been about monolithic kernels over microkernels, so "do one thing" is out the window, and about worse-is-better over do-the-right- thing ([https://www.dreamsongs.com/RiseOfWorseIsBetter.html](https://www.dreamsongs.com/RiseOfWorseIsBetter.html)), so "do it well" is out the window.

And the userspace tools don't follow this either. Quoting [http://prog21.dadgum.com/139.html](http://prog21.dadgum.com/139.html) :

> _The UNIX ls utility seemed like a good idea at the time. It 's the poster > child for the UNIX way: a small tool that does exactly one thing well. Here > that thing is to display a list of filenames. But deciding exactly what > filenames to display and in what format led to the addition of over 35 > command-line switches. Now the man page for the BSD version of ls bears the > shame of this footnote: "To maintain backward compatibility, the > relationships between the many options are quite complex."_

Why, for instance, does ls have its own sorting options if the sort command exists? If ls, the most quintessential UNIX command, can't do one thing and do it well, why should anything else?

<comment><USER3> The Unix philosophy is most applicable in user space. It's a philosophy not a law. I didn't say Systemd was bad just that it doesn't observe the Unix philosophy.

Crashing an init process is a very bad thing, is it not? Wouldn't less surface area be a better approach?

<comment><USER4> Yes, I argued in another comment that it would be a good idea to split systemd into two processes, where PID 1 does nothing other than reap children, send info to PID 2 actual systemd, and restart PID 2 if needed. But it seems to make sense for PID 2 to be as monolithic as systemd currently is (which is not very monolithic; udev, journald, D-Bus, etc. are separate daemons).

<comment><USER5> That's a common misconception. The major task of process #1 with modern kernels is not, ironically, reaping children but receiving signals. Reaping orphaned children can be, and with several softwares is, the job of other processes.

* [https://news.ycombinator.com/item?id=8904429](https://news.ycombinator.com/item?id=8904429)

* [http://unix.stackexchange.com/a/197472/5132](http://unix.stackexchange.com/a/197472/5132)

* [https://news.ycombinator.com/item?id=8384251](https://news.ycombinator.com/item?id=8384251)

* [http://unix.stackexchange.com/a/177361/5132](http://unix.stackexchange.com/a/177361/5132)

<comment><USER4> That makes no sense. Who's sending SIGWINCH to pid 1? Is it in a tty? Why is it in a tty? Why does it care about the size of its window?

It is true that _the userspace helper programs of some init system suites_ , such as sysvinit's telinit, work by sending signals to pid 1. But 1) they send signals to pid 1 because pid 1 is the service manager, not because it's the system manager, and 2) they could do something else other than sending signals (like sending D-Bus messages). The choice to use signals is a design decision of the init system suite, and not a part of the inherent requirements of being pid 1.

It is also true that with prctl(PR_SET_CHILD_SUBREAPER) you can move reaping away from pid 1. But at that point, the proper function of pid 1 is _nothing_ , except perhaps to respawn pid 2 if it wants to. And as I argued in the other comment in this thread [https://news.ycombinator.com/item?id=12600734](https://news.ycombinator.com/item?id=12600734), that's silly and you should just make the kernel do it.

I don't see any explanation in any of those links, or the things they link to, about why pid 1 is receiving signals. You claim twice that SIGINT, SIGPWR, and SIGWINCH are things that pid 1 can receive, but I have no idea why it might receive them. Can you explain?

<comment><USER5> It's explained two times over, and they are indeed system state controls, not service state controls.

You are exemplifying the people with off-the-top-of-the-head designs for init that I mentioned. The signals to process #1 from the kernel are rarely included, or even thought of, in such designs; despite the fact that they are the things that a process #1 program cannot escape and the child reaping is actually the least of its work and the thing that it can mostly escape. Here you are with yet another off-the-top-of-the-head design being thrashed out in a discussion forum, and you have not even encountered this stuff to know that a design has to include it, as evidenced by the questions about TTYs and windows.

As I said, go and look at many _actual_ process #1 programs, such as Gerrit Pape's runit, Felix von Leitner's minit, and the system-manager program from the nosh package. They all have to handle these signals, and they all do. Don't repeat ... ahem! ... some other people's mistake of not learning about existing softwares and mechanisms.

The nosh system-manager and systemd both discuss them in their manual pages. They both have an explicit list of signals and what they trigger. The manual for /etc/inittab in van Smoorenburg init also discusses these signals and what they are, as do the manual for Joachim Nilsson's finit ([http://troglobit.com/finit.html](http://troglobit.com/finit.html)) and its TODO list.

I recommend some manual reading. (-:

<comment><USER4> OK, I went and learned some things and it turns out I was wrong but (at least assuming Linux, which is fair since this is a thread about systemd) you're wrong too. None of these signals have to be handled by pid 1.

SIGWINCH for a keyboard request is a thing that I did not know about, yes. But this is opt-in functionality for any process that has any VT open and is suitably privileged, and it is simply traditional for init to call ioctl(0, KDSIGACCEPT, SIGWINCH). Any process can request this, not just init; any signal can be used, not just SIGWINCH. And by default, no signal gets sent, neither to init nor to any other process. So init does not need to handle it.

(This of course leaves aside the question of whether anyone uses this functionality. How many users who are _not_ init system developers know about this? And how many people have machines with physical keyboards that are not just running some window system that puts the keyboard in raw mode, anyway?)

See [https://github.com/torvalds/linux/blob/v4.7/drivers/tty/vt/k...](https://github.com/torvalds/linux/blob/v4.7/drivers/tty/vt/keyboard.c#L98-L102) and L593-602 (initialized to 0 and disabled by default), [https://github.com/torvalds/linux/blob/v4.7/drivers/tty/vt/v...](https://github.com/torvalds/linux/blob/v4.7/drivers/tty/vt/vt_ioctl.c#L578-L592) (KDSIGACCEPT ioctl allows any suitably privileged process to request this), and [http://www.fifi.org/doc/console-tools- dev/examples/spawn_log...](http://www.fifi.org/doc/console-tools- dev/examples/spawn_login.c) (a separate daemon for doing this - via SIGHUP, incidentally - which says, "Note: this functionality has become part of init", implying it was originally _not_ part of init!).

SIGINT on Ctrl-Alt-Del (if reboot(LINUX_REBOOT_CMD_CAD_OFF) has been called), and SIGPWR on power failure from the two drivers that implement it, are sent via the kill_cad_pid() function. This _does_ default to pid 1, but that's just a default. And it's very easy to change that setting in userspace; it's a sysctl, /proc/sys/kernel/cad_pid.

See [https://github.com/torvalds/linux/blob/v4.7/init/main.c#L998](https://github.com/torvalds/linux/blob/v4.7/init/main.c#L998), which defaults cad_pid to init, and [https://github.com/torvalds/linux/blob/v4.7/kernel/sysctl.c#...](https://github.com/torvalds/linux/blob/v4.7/kernel/sysctl.c#L2666-L2686), the sysctl implementation.

The two drivers that implement SIGPWR, incidentally, are the S390 NMI handler and the SGI SN Platform's system controller driver, both of which I'm pretty sure see no use today. It's usually sent by a userspace process these days, which again could just choose to not use signals.

So none of the signals you've mentioned are pid 1's responsibility, They are _traditionally_ pid 1's responsibility, yes. But those are two very different things, especially if we're talking about using PR_SET_CHILD_SUBREAPER to move all the interesting work out of pid 1.

The remainder of the signals handled by sysvinit, finit, runit, and nosh are all generated by userspace, and minit handles no other signals. And not all of these init systems bother to call KDSIGACCEPT.

I recommend being less condescending, especially if you're going to be wrong. (-:

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> First they came for PID 1, and we were silent.

Oh, wait, we weren't. But although I don't miss the rickety init scripts, I've grown more and more worried about stuff like this, enough to ponder replacements (in Go or Python, which seem to be generally acceptable for systems software these days).

Ignoring for the moment the usual biases against Python, how feasible/how much support would it be/have to build something to replace systemd (by having PID 1 do the minimum possible, in C, and having the rest done with Python)?

<comment><USER7> I've been working at a Docker shop for a while and I have a feeling it will be the future for running services. It makes systemd somewhat irrelevant.

There are still a lot of issues I've had with Docker, which I won't go into. It also can't replace everything running on your Linux system. But it's a neat idea and big players use it in production for huge workloads.

Now the whole AWS-containers, docker-machine, swarm, mesos, coreos, kubernetes thing is a cluster fuck of choices .. but you have choices. And unlike running an Ansible script on some provides base image (which is totally different from Rackspace, Linode, etc.), you are guaranteed your container will work on any docker engine with little modification (your orchestration files may change though).

I have a feeling, for better or worse, containers will be the future and will stick around long after systemd hopefully dies.

<comment><USER8> Nah, systemd is angling to supplant docker for containers.

There is already a great deal of bad blood between the two because of the reworked cgroups management.

And there is also the likes of CoreOS that is basically systemd-the-distro.

Never mind that we have the likes of xdg-app/flatpak that is basically aiming for what you are thinking about, and it is systemd dependent.

<comment><USER9> It was quite amusing seeing systemd causing systemd-specific trouble in CoreOS development though, such as systemd requiring too much privilege when running inside container. Many people just use s6 happily.

<comment><USER8> The schadenfreude is real.

</comment></comment></comment></comment></comment><comment><USER10> > The immediate question raised by this bug is what kind of quality assurance > process would allow such a simple bug to exist for over two years (it was > introduced in systemd 209). Isn't the empty string an obvious test case?

All bugs are terribly easy to spot in hindsight. I don't think it's fair to criticize this one in that fashion. Systemd has lots of pros and cons, but the age of this bug isn't interesting IMO. Its severity is, but that only speaks to the critical need to patch it ASAP.

</comment><comment><USER11> Archived page, since it's not loading for me... [http://archive.is/8xUSY](http://archive.is/8xUSY)

<comment><AUTHOR> My hosting provider thought I was under DDoS attack and started aggressively throttling port 443. I failed over to my backup provider, probably permanently.

</comment></comment><comment><USER12> The issue has a bug report on the systemd repo on Github: [https://github.com/systemd/systemd/issues/4234](https://github.com/systemd/systemd/issues/4234)

</comment><comment><USER13> At this point in time my biggest frustration is that even compared to upstart writing concise and clear config files for network services is just really hard, and there isn't great documentation or a short book around that covers all the edge cases other than TIAS. I feel like I've wasted more time trying to get a tidy systemd configuration than I ever had even with upstart or some of the other ones.

</comment><comment><USER14> This article got me wondering if maybe the NSA or similar has somebody on the inside of the systemd project that is helping the project along.

Systemd has replaced a lot of init systems in the linux ecosystem and the general development practices of the project is leaving a huge footprint of code that might be exploited.

If they aren't involved, I'm sure they probably know a few different exploits for the system already.

<comment><USER15> If you want to go down that rabbit hole, see:

[https://igurublog.wordpress.com/2014/02/17/biography-of-a- cy...](https://igurublog.wordpress.com/2014/02/17/biography-of-a-cypherpunk- and-how-cryptography-affects-your-life/)

</comment></comment><comment><USER16> This is an excellent writeup explaining without hysterics why systemd is terrible software. Unfortunately, I expect that this post will be brigaded by systemd-apologists anyways, denying newcomers to the debate the opportunity to hear the facts...

<comment><USER17> I'm not sure how this comment is helpful to the discussion. As far as I can tell, you'd rather _only_ hear the facts that fit your opinion of systemd as terrible software. I think the obvious right answer is that both sides present only facts and let newcomers decide based on that.

<comment><USER16> As the other reply said, the problem is that newcomers aren't allowed to hear the anti-systemd facts, as the systemd gods have already decided that all Linux users (or at least all distros) must bow down and accept them, and no dissenting opinion is allowed to stay on the front page of HN for long (this post has already been brigaded off the front page, apparently).

<comment><USER18> It could be the "controversial topic" penalty, which is extremely heavy- handed. But I also notice that both anti-systemd and pro-other-init-system posts and comments are barraged with downvotes on all kinds of forums, including HN. It is definitely something that certain people don't want out in the world.

</comment></comment></comment></comment><comment><USER4> I've been thinking for a bit that it's reasonably easy to write a PID 1 that reaps children and sends siginfo_t structs over a pipe to PID 2, which can be an init system as monolithic as you want.

Of course, it would _also_ be simple for the kernel to allow PID 1 to die/crash, and just restart it instead of panicking. I don't know why the kernel continues to treat PID 1 so specially—if the ewontfix.com PID 1 is sufficient, it's _simpler_ for the kernel not to bother with the reparenting logic and stop treating PID 1 as a special process.

<comment><USER19> > I don't know why the kernel continues to treat PID 1 so specially

By design all processes inherit from PID 1 (directly or indirectly), so you always have an unbroken tree from every process back to PID 1. PID1 aka init is supposed to do bookkeeping (e.g. zombie processing), and if PID1 crashes the bookkeeping records are lost.

Because of this, it is better to fail hard, instead of allowing for corrupted process trees or similar.

Also, ps, top and basically every program that works with processes expects one root process for the tree. Breaking this would basically break compatibility with every existing userland (which the kernel cares the most about!)

<comment><USER20> > Breaking this would basically break compatibility with every existing > userland

By "Breaking this" you mean "fixing the fact that pid 1 can't crash and restart"?

> Because of this, it is better to fail hard

It can't be fixed because it would "break compatibility" where that "compatibility" is that the machine should panic?

You're not really making a good case for why this can't be changed.

Why not

      * pid 1 exits
      * kernel re-executes init as a new pid 1
      * userspace continues on as if nothing happened.

<comment><USER4> Right. If init opts into it, e.g. by setting some sysctl or something, the kernel changes behavior in the following way:

1\. Processes that are reparented to init aren't actually considered children of init for the purposes of the wait() system call. Their ppid still becomes 1, so parent process walks work, but when they exit, the kernel immediately cleans them up.

Zombies still exist in this change, as long as their parent still exists; the only thing that changes is that processes (zombies or not) are not reparented to init when their parent dies. Direct children of pid 1 are not treated specially.

2\. When init is about to exit or crash, the kernel turns it into a zombie. It then starts a new init process and reparents the old init to the new one, allowing it to do things depending on the cause of the crash. Direct children of the old init have lost their parent, and are treated like any other parentless process as described above.

3\. If execing the new init fails, the kernel panics.

This would be completely backwards-compatible. (I might even argue against 3, to remove all worry about init crashing; since pid 1 is no longer required to do anything, if exec fails, the kernel can just leave pid 1 as a stuck process table entry, let the system continue running, and log something to dmesg so the sysadmin can diagnose the problem and reboot the machine cleanly.)

<comment><USER20> Sounds reasonable. Any ideas why no one has ever done this?

Kind of reminds me when the behavior of rm -rf / was changed in solaris.

I can't find the article, but basically someone pointed out that they couldn't change the behavior of rm -rf / because posix defined how it should work. Someone then pointed out that the spec says that trying to remove the parent directory(i think?) should fail, and since rm -rf / includes removing the parent directory, it was within the spec that it should fail.

</comment></comment></comment></comment></comment><comment><USER5> Lennart Poettering's response to this was interesting:

> _The bug is caused by an error check that filters out garbage sent to PID 1. > The check works correctly, except that the resulting action is a too harsh: > instead of complaining and dropping it will abort the process._

* [https://www.reddit.com/r/linux/comments/54yfcd/how_to_crash_...](https://www.reddit.com/r/linux/comments/54yfcd/how_to_crash_systemd_in_one_tweet/d86rs74)

In fact, the opposite was the case. The root of the problem was identified in the GitHub bug report:

* [https://github.com/systemd/systemd/issues/4234#issuecomment-...](https://github.com/systemd/systemd/issues/4234#issuecomment-250431337)

* h[https://github.com/systemd/systemd/commit/d875aa8ce10b458dc2...](https://github.com/systemd/systemd/commit/d875aa8ce10b458dc218c0d98f4a82c8904d6d03)

What happened was that Lennart Poettering _removed an error check_ that filtered out zero-length messages. This left the flow of control to fall through to a later point where an assertion, that had been earlier added by Lennart Poettering with the assumption that this check for zero was in place (as it had been at the time), then triggered.

Of course, no-one that I have seen has yet asked why "" as a command-line argument to systemd-notify results in a zero-length message in the first place. After all, according to the doco that would be length 1, a single terminating LF byte, not zero length. That said, the server still should be proof against zero-length network input.

</comment><comment><USER21> A CVE has been requested, albeit after publication of the bug:

[http://www.openwall.com/lists/oss- security/2016/09/28/9](http://www.openwall.com/lists/oss- security/2016/09/28/9)

<comment><USER5> Discussed on Hacker News at [https://news.ycombinator.com/item?id=12600994](https://news.ycombinator.com/item?id=12600994) .

</comment></comment><comment><USER9> Lennart Poettering has replied on Reddit.

[https://www.reddit.com/r/linux/comments/54yfcd/how_to_crash_...](https://www.reddit.com/r/linux/comments/54yfcd/how_to_crash_systemd_in_one_tweet/d86rs74)

> So let's summarize this. There's a bug in some software. OMG! Shock! This of > course never happened before!

> The bug is in not exploitable remotely. The bug does not allow privilege > escalation nor insertion of code. This of course makes the bug a massive > vulnerability like there was no other on the planet ... ever. As bad as > heartbleed multiplied by the Debian OpenSSL random generator bug to the > power of 10.

> The bug is caused by an error check that filters out garbage sent to PID 1. > The check works correctly, except that the resulting action is a too harsh: > instead of complaining and dropping it will abort the process. Such a bug is > of course unprecedented and the authors of said software should be stoned > and flogged right away given the severity of the issue: after all a safety > check worked a bit too well, and we really can't have that because undefined > behaviour of course would be a lot better than a local DoS.

> The project the error was found in is large. Yet the number of CVEs collect > so far is pretty small comparing it witht other projects of similar extent. > Given that another bug was discovered now this obviously shows how > incompetent the programmers are and that security is a unknown concept to > them.

> The program the bug was found in is longer than 50 lines of code but runs > with privileges, all written in a low-level programming langauge that many > call little more than a fancy macro assembler. The code runs on top of an > operating system kernel written in the same language but running with a lot > higher privileges and consisting of expoentially more lines of code > including drivers of questionnable quality. This together is of course proof > that the project at hand is flawed conceptually to its core.

> Dha!

> Lennart

> (More seriously: yes this is a bug, we should fix it. But it's very low > impact and the bruhaha it generated appears wildly out of scale. If all bugs > in the wider Open Source ecosystem would have a similarly low impact we'd > live in a much much safer world!)

</comment><comment><USER22> You could simple do a DoS attack with a local user using a fork bomb too. It would be even shorter than the command showed in this post blog.

So while this is a bug, the author is overreacting just to make systemd look bad.

<comment><USER23> your fork bomb can be mitigated with ulimit

<comment><USER22> I am not saying that this is not a bug, just that this isn't the problem that the author is making. If you have local access, you probably can do other things if your only objective is to do a DoS.

<comment><USER24> Your point is covered in the article.

"If you think systemd doesn't need privilege separation because it only parses messages from local users, keep in mind that in the Internet era, local attacks tend to acquire remote vectors. Consider Shellshock, or the presentation at this year's systemd conference which is titled "Talking to systemd from a Web Browser.""

</comment></comment></comment></comment><comment><USER25> Ran as a normal user on debian jessie, and now ssh logins are delayed by 30 seconds. I don't see any other problems yet, but this is a VM host and so leave it running for a while for fun. :)

<comment><USER21> Ran it on an up to date Ubuntu 16.04 and lost the ability to run any systemctl commands like status, restart, etc. Web server and other system services were still working, but I couldn't `reboot` or `systemctl halt` etc... had to hard reboot the VPS from hosting console. :)

<comment><USER26> "systemctl reboot --force --force" should work in such cases. The reboot will be executed by systemctl itself.

</comment></comment></comment><comment><USER5> It's interesting to see a "hacker" discussion of this that entirely misses several topics that one would expect programmers to at least mention:

* Whether release builds should have assert() enabled.

* Whether a process #1 program should use assertions at all.

* Whether assert() is the right mechanism to use for input validation.

* How a process #1 program should recover from assertion failures.

</comment><comment><USER27> Don't really care about that bug, it will be fixed I'm sure. But thank you for this post anyway, the word LLMNR caught my eye, very nice to have if it works.

EDIT: works fine with Windows, without installing Bonjour/iTunes.

</comment><comment><USER28> > "Systemd is defective by design."

The most succinct explanation of Systemd possible.

<comment><USER29> I've complained a few times that systemd haters havent explained the hate.

having read this post I'd say a slightly less succinct but infinitely more informative version would be

> "Systemd is defective by design because they totally disregard the fail-safe > by design rules"

<comment><USER30> Yes. I wish people would explain their hatred. I understand that there are valid reasons to hate systemd, which is why I avoid it like the plague. But so many people get sucked in by the initial usefulness, and don't see the problems lurking beneath the surface.

<comment><USER18> Yes, a large part of which is the _process_ behind systemd. You're adopting more than just software when you adopt software, and I think investigating what the systemd developers are like is a worthy exercise -- in particular how they approach bugs. I think most people would be surprised to learn what that is like.

<comment><USER30> Ah, yes: When is a bug not a bug? According to the systemd developers, it's when we don't encounter it on our personal machines.

<comment><USER18> ... And also when they can pass the buck to kernel developers, even when it's not a kernel bug.

<comment><USER8> Reminds me that i ran into an email chain a while back where the kernel devs pondered forking or taking over udev development because they were tired of power games from the maintainer. This was from back before udev became part of systemd btw.

<comment><USER30> Greg-KH is both one of the original developers on udev and a major force behind systemd. He maintains -stable on the linux kernel.

So either the kerbel devs did take over udev development...

<comment><USER8> I do wonder if the kernel will split between GregKH and T'so once Torvalds steps down.

BTW GKH was oddly absent in that thread, and the kernel devs ire was aimed at Sievers...

<comment><USER30> Well, GKH is One Of Them. He's less likely to attract their ire, and if he does, at the end of the day, they have to answer to him.

But in a fight between GKH and T'so, I'll take T'so. /dev/random's ...interesting design aside, I frankly trust T'so far more than I trust GKH, who backs LP, a person I emphatically do _not_ trust, in a lot of things.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER31> >Despite the banality, the bug is serious, as it allows any local user to trivially perform a denial-of-service attack against a critical system component.

Is it really that serious of a bug? You have to be a local user in order to execute it. Are other OS's somehow resilient to the actions of local user to degrade the OS?

>The Linux ecosystem has fallen behind other operating systems in writing secure and robust software. While Microsoft was hardening Windows and Apple was developing iOS, open source software became complacent.

He must be unaware of the numerous patches Microsoft and Apple issue on a regular basis to fix their "secure and robust software".

<comment><USER32> Any remote code execution bug can exploit this. Normally, a remote execution code bug when the user is non-root isn't a huge issue, because the user effectively sandboxes them away. This bypasses all of these benefits.

Containers may prove to be a sufficient sandbox, assuming this is not executable against kdbus (which is shared across containers since it's in the kernel).

</comment></comment><comment><USER33> Erm, this does not actually seem to work on Centos7, running systemd-219-19.el7_2.13. Even tried it as root inside of a sandbox - nothing.

<comment><USER12>
      while true; do NOTIFY_SOCKET=/run/systemd/notify systemd-notify ""; done

Try this. As soon as you loop it, the bug is hit pretty quickly.

<comment><USER34> I don't understand why that makes a difference if the bug is `assert(n > 0)`

<comment><USER5> There is a race in the systemd-notify mechanism that means that some notification messages get discarded if the systemd-notify process happens to complete its work and exit before systemd picks up the message. They never reach the point of the assertion that is triggered here, because systemd is unable to determine the service unit that encompasses the message sender.

* [http://jdebp.eu./FGA/unix-daemon-readiness-protocol-problems...](http://jdebp.eu./FGA/unix-daemon-readiness-protocol-problems.html#SynchronousProtocol)

</comment></comment></comment></comment><comment><USER35> Doesn't work here on Ubuntu 16.04 xenial

<comment><USER36> I've put a comment on the github bug with an updated PoC. IT does work on 16.04, but you seem to have to do it over and over until it triggers. A working PoC seems to be:

while true; do NOTIFY_SOCKET=/run/systemd/notify systemd-notify ""; done

</comment></comment><comment><USER37> Note: 112 comments from the peanut gallery before someone looked at the code enough to submit the trivial fix.</comment>


Company-Wide Email From Apple CEO Tim Cook - <AUTHOR> http://daringfireball.net/linked/2011/08/25/cook

<comment><USER2> That email seemed a waste of bandwidth to me. I mean, talk about stating the obvious. But I suppose he had to chime in with something.</comment>


Ask HN: Can I use a survey developed by a university professor? - <AUTHOR>

Hello HN,
I would like to use a survey developed by a university professor on our website legitimately. Unfortunately, this professor passed away in 1988. Since then there has been a number of academic publications that have used his surveys by simply citing his work.
Am I allowed to use his surveys providing I cite his work? Or are there a few more legal or copyright implications I need to consider and it is best to contact his former university and publisher?
I look forward to any guidance. Thank you. <comment><AUTHOR> For anyone's future reference, the university professors I spoke with recommended the following for academic or research purposes.:

1) If the survey is publicly available and does not have controlled usage you can simply cite the source of the survey.

2) If you modify some part of it you will need to be explicit about that e.g. "as modified in October 2010 by (your name)" or "as modified by the author."

For commercial purposes this might be different, in which case you should contact the publisher and make a request.

My situation is for research purposes but I will contact the publisher to be sure.</comment>


Slide design: signal vs. noise (redux) - <AUTHOR> http://www.presentationzen.com/presentationzen/2007/03/a_few_weeks_ago.html <comment><AUTHOR> Excellent deconstruction of a Whole Foods presentation. I'm a bit shocked that a CEO would come to Berkeley with PPT slides containing ugly Excel charts that are impossible to understand unless you were sitting in front of the monitor.

<comment><USER2> He's a CEO. I'd be shocked if he didn't come to a presentation with PPT slides & Excel chart combination. :)

On a more serious note, I think the idea that PPT slides full of text are helpful is basically entrenched in corporate culture. I wish everyone used Lessig's approach.</comment></comment>


Linux 4.17: add support for the Speck block cipher - <AUTHOR> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da7a0ab5b4babbe5d7a46f852582be06a00a28f0 <comment><USER2> This really sucks. This is supporting a cipher with questionable design decisions and the authors have been combative when confronted with technical questions.

I don't know if it's backdoored but I certainly don't want it supported by the mainline kernel as it would aid acceptance even though the ISO rejectes it.

</comment><comment><USER3> You can disable this in the kernel by unsetting CONFIG_CRYPTO_SPECK.

<comment><USER4> Is there some particular reason why you'd want to? "Controversial" it may be, backdoored even, but just having it isn't going to compromise your machine.</comment></comment>


Show HN: A NLP Library for Matching Parse Trees - <AUTHOR> https://github.com/ayoungprogrammer/Lango <comment><USER2> If you clicked through to the two links from laretluval and brudgers, you can see why natural language processing as a field is struggling to gain quick adoption (in proportion to well understood concepts). Look at laretluval's links: The people who are doing the hardcore research are doing a really poor job of explaining what exactly they are trying to accomplish. Can a programmer who is good at programming but not familiar with computer science concepts actually figure out what exactly tregex does, even after reading the page a few times? Do you seriously expect someone to download a PPT file (yes, ppt, not a pdf) to understand the basics?

Contrast that with brudgers link - it is actually a readable summary even though I personally think the person who posted that blog entry still needs to learn more concepts in NLP/English grammar/hierarchical data structures to scale the project \- all his examples are active voice \- using regex will fail as the sentence becomes more run on like the one you are currently reading \- hand crafting rules for English grammar is actually super hard because even trained linguists sometimes disagree on the parse tree produced by fairly short sentences (I think I learnt that from watching a YouTube video by Chris Manning, unfortunately I don't have the reference right now)

I don't understand how the NLP community seems so oblivious to this issue.

<comment><USER3> I agree with your criticism in general, but the lack of outsider-friendly explanation here seems justified because something like a parse tree matcher is more of a tool that's useful inside the NLP research community than for end users. When does an end user ever need to find trees with a particular syntactic structure? On the other hand, it is very useful for debugging parsers, verifying annotation standards in corpora, etc.: things that NLP researchers have to do.

There is some NLP software that does a great job of explaining what it does, how it does it, and why this is useful. [http://spacy.io/](http://spacy.io/) comes to mind. Maybe that's the happy exception.

<comment><USER2> Spacy's website looks good. Thanks for the heads up.

<comment><USER4> Unfortunately the two demos 404 at the moment. I hope we can have everything back online soon.

</comment></comment></comment></comment><comment><USER3> Similar software for matching parse trees:

Tregex: [http://nlp.stanford.edu/software/tregex.shtml](http://nlp.stanford.edu/software/tregex.shtml) tgrep2: [http://tedlab.mit.edu/~dr/Tgrep2/](http://tedlab.mit.edu/~dr/Tgrep2/)

</comment><comment><USER5> Related blog post: [http://blog.ayoungprogrammer.com/2016/07/natural-language- un...](http://blog.ayoungprogrammer.com/2016/07/natural-language- understanding-by.html/)

</comment><comment><USER6> This would be really cool to apply to programming languages. That is, matching abstract syntax trees together.

This way you could identify similar chunks of code. I had an idea related to this for identifying security vulnerabilities: [https://news.ycombinator.com/item?id=11573547](https://news.ycombinator.com/item?id=11573547)

</comment><comment><USER7> Nice. I started on an impl in Java several years ago but never got far ([https://github.com/bpodgursky/nlpstore/blob/master/src/test/...](https://github.com/bpodgursky/nlpstore/blob/master/src/test/java/com/bpodgursky/nlpstore/graph/query/TestQuerier.java)).</comment>