User: Password:
|
|
Subscribe / Log in / New account

Poettering: The Biggest Myths

Poettering: The Biggest Myths

Posted Jan 27, 2013 8:01 UTC (Sun) by apoelstra (subscriber, #75205)
In reply to: Poettering: The Biggest Myths by lkundrak
Parent article: Poettering: The Biggest Myths

> I sometimes feel ashamed that I'm not as vocal as people who for some reason oppose systemd while it significantly improves my Linux experience.

I second this. Being able to throw up a 5-line systemd service file for a new daemon (without trolling through mailing lists looking for prewritten scripts and gotchas) is wonderful.


(Log in to post comments)

Poettering: The Biggest Myths

Posted Jan 27, 2013 11:17 UTC (Sun) by alankila (guest, #47141) [Link]

I wrote an upstart script to start some php thing as fastcgi daemon and it sucked. "expect fork" is part of the definition, indicating that the program was expected to fork once before running as a daemon, something upstart needs to be told, but systemd should be able to track the process no matter how many times it forks or doesn't fork.

Either way, I screwed up somewhere and failure at writing the init job definition caused upstart to no longer be able to startup and shutdown that particular service, it seemed to just stall. Killing the php processes didn't help, upstart was still stuck waiting on the service somehow. I couldn't even shutdown the machine anymore because it kept on jamming on that service file forever, forcing a manual power off. Again, on systemd, the fact I killed the process is enough evidence that the service is down, so systemd wouldn't have had the problem in the first place, and if it did, it would have been able to recover because it's actually smart.

I can only hope that I get to enjoy systemd at some point in the future as well. upstart is maybe fine if you know exactly how it works and know how to debug it; systemd seems almost designed for clueless admins like me.

Poettering: The Biggest Myths

Posted Jan 27, 2013 12:20 UTC (Sun) by davidstrauss (subscriber, #85867) [Link]

> systemd should be able to track the process no matter how many times it forks or doesn't fork.

Correct. It's also one of the features that cannot be portable; it relies of cgroups.

> Again, on systemd, the fact I killed the process is enough evidence that the service is down

Ditto.

Poettering: The Biggest Myths

Posted Jan 27, 2013 20:56 UTC (Sun) by cwillu (guest, #67268) [Link]

In fairness to upstart, "expect fork" and "expect daemon" are not something that can be detected by the init system even in principle. Yes, even if that init system is systemd. Which is why http://www.freedesktop.org/software/systemd/man/systemd.s... has a Type=simple|forking option and various forms of PID guessing to distinguish between the cases handled by upstart's "fork" vs "daemon".

Poettering: The Biggest Myths

Posted Jan 28, 2013 0:45 UTC (Mon) by davidstrauss (subscriber, #85867) [Link]

> In fairness to upstart, "expect fork" and "expect daemon" are not something that can be detected by the init system even in principle.

The difference is that Upstart can't reliably detect what's going on, let alone know whether it's correct.

systemd can detect what's going on, regardless of how you have the service configured. The configuration allows systemd to compare what is happening against what it's detecting to know whether the service is in a failed state.

Poettering: The Biggest Myths

Posted Jan 28, 2013 1:55 UTC (Mon) by mezcalero (subscriber, #45103) [Link]

Actually, systemd cannot detect the main process in all cases. If you use Type=forking (without specifying a PID file) and your daemon starts many processes at once before exiting in the parent, then we don't know which one of the remaining ones the "main" one should be. In that case systemd will consider the service exited only after *all* processes are gone, and can't collect as much state info about it... Thankfully, this case is quite seldom, the impact is low, and is easily fixed by specifiying a PID file, or by using Type=notify (after updating the daemon).

Upstart's tracing via ptrace() is one evil feature OTOH. Upstart basically becomes the debugger of the daemons it runs. Really, really evil stuff.

Poettering: The Biggest Myths

Posted Jan 28, 2013 2:53 UTC (Mon) by davidstrauss (subscriber, #85867) [Link]

> Actually, systemd cannot detect the main process in all cases. If you use Type=forking (without specifying a PID file) and your daemon starts many processes at once before exiting in the parent, then we don't know which one of the remaining ones the "main" one should be.

I wasn't speaking to detecting the main PID, only what is happening in terms of all forking behavior. When a process forks into a ton of other processes in the way you describe, there is no amount of collectable data on the system that allows properly identifying the main PID every time.

Poettering: The Biggest Myths

Posted Jan 27, 2013 14:03 UTC (Sun) by pizza (subscriber, #46) [Link]

Third!

systemd is such a vast improvement over what came before that it's not even funny.

Poettering: The Biggest Myths

Posted Jan 27, 2013 18:58 UTC (Sun) by apoelstra (subscriber, #75205) [Link]

Let me give a specific example. A week ago I wanted to set up a hunchentoot (lisp) web server, which involves starting a lisp instance, running some sort of setup lisp code, and leaving it running on some console somewhere.

Various Internet searches gave me 50-60 line init scripts for old versions of Ubuntu. These scripts were long and opaque and probably not even close to something that would run on Fedora 18. They relied on the detachtty tool (a minimal screen-type program) and did some sort of $PID dance around this. I wanted the server to restart whenever I killed it, so that I could reload the setup code that way. (Also I kept accidentally killing it by hitting Ctrl+D into screen.)

There's nothing out there about using hunchentoot with systemd. So, with maybe five minutes of searching manpages, I wrote

#======
User=lisp-web

[Unit]
Description=Run sbcl webserver session on a screen tty
After = syslog.target network.target

[Service]
User=lisp-web
Type=simple
ExecStart=/usr/bin/screen -D -m /bin/sbcl --load-path /home/lisp-web/ --load default-server.lisp
Restart=on-success
#======

Short, simple, clear, works correctly, tells me when things go wrong, etc, etc. I can connect to screen and hit Ctrl+D to reliably restart the server. It never hangs or gets out of sync or leaves ports in use or files locked.

Poettering: The Biggest Myths

Posted Jan 27, 2013 21:11 UTC (Sun) by pizza (subscriber, #46) [Link]

This "thread" finally motivated me to write a systemd unit file for my photo organizer's background threads. I don't know why I put it off so long.

It took me under five minutes. Would have been less time if the Fedora 16 server it's running on had a more modern systemd installed.

Trolling?

Posted Jan 28, 2013 13:23 UTC (Mon) by pboddie (guest, #50784) [Link]

You mean trawling, surely, although I imagine that trolling is a way of getting answers from mailing lists, too.

Sorry for the pedantry, but I keep reading "trolling" used in this sense and assume that it must be either incorrect or American English. At least if it is the latter, the same cannot be said for the epidemic of "loose" (instead of "lose") and the unbearably irritating "choosen" (instead of "chosen").

Trolling?

Posted Jan 28, 2013 13:51 UTC (Mon) by mpr22 (subscriber, #60784) [Link]

Funny thing: I hadn't even noticed the existence of "choosen", and can't imagine it being more irritating than the loose/lose confusion. (Of course, this is what we get for using an orthography invented by non-native speakers 900 years ago, barely upgraded since, and at this point prohibitively expensive to reform.)

Trolling?

Posted Jan 28, 2013 14:35 UTC (Mon) by tnoo (subscriber, #20427) [Link]

Ask Lennard for a new implementation.

Trolling?

Posted Jan 28, 2013 16:27 UTC (Mon) by HelloWorld (guest, #56129) [Link]

> Lennard
Speaking of spelling...

Trolling?

Posted Feb 9, 2013 22:50 UTC (Sat) by cas (subscriber, #52554) [Link]

it's the new and greatly improved way of spelling Lennart and if he doesn't like it, he's free to fork and go his own way.

Trolling?

Posted Jan 28, 2013 15:50 UTC (Mon) by Wol (guest, #4433) [Link]

I've lost context, but both trawling and trolling are means of fishing.

A trawler goes trawling with a trawl-net.

Dunno what the proper name of a troller is, but they go trolling with a troll-line. Most tuna, for example, is caught by trolling.

I've been trolling for mackerel ...

Cheers,
Wol

Trolling?

Posted Jan 29, 2013 14:23 UTC (Tue) by pboddie (guest, #50784) [Link]

I suppose I have learned something from this, never having been very interested in fishing at all. And I imagine that the Internet era meaning of the word is derived from this practice of using a baited line:

http://oxforddictionaries.com/definition/english/troll--2

The interesting thing here is that the example given on the above page is rather similar to the one used earlier, but unless one attracts the catch using bait - putting something out to attract the catch - the trawling metaphor is actually more appropriate, since one is just seeing what gets dragged up. But anyway...


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds