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

Poettering: The Biggest Myths

Poettering: The Biggest Myths

Posted Jan 27, 2013 20:56 UTC (Sun) by cwillu (guest, #67268)
In reply to: Poettering: The Biggest Myths by alankila
Parent article: Poettering: The Biggest Myths

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".


(Log in to post comments)

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.


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