|
|
Log in / Subscribe / Register

How Debian managed the systemd transition

How Debian managed the systemd transition

Posted Sep 16, 2015 22:28 UTC (Wed) by luto (subscriber, #39314)
In reply to: How Debian managed the systemd transition by Cyberax
Parent article: How Debian managed the systemd transition

What if kdbus is killed or fails to start? Then you panic. Surely the failure mode if userspace dbus is killed or fails to start is no worse than that.

Similarly, if systemd is killed or fails to start, you panic.


to post comments

How Debian managed the systemd transition

Posted Sep 17, 2015 1:33 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (7 responses)

PID1 can not be killed by SIGKILL, a separate DBUS daemon most definitely can be.

How Debian managed the systemd transition

Posted Sep 17, 2015 1:36 UTC (Thu) by luto (subscriber, #39314) [Link] (5 responses)

So what? If you start SIGKILLing random system daemons, you can't really expect your system to do very well. This is solidly in the "doctor, it hurts when I do that" category.

How Debian managed the systemd transition

Posted Sep 17, 2015 4:25 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

That's a violation of the current API/ABI contract - you can kill all the processes on a normal system and leave it running.

How Debian managed the systemd transition

Posted Sep 17, 2015 5:59 UTC (Thu) by luto (subscriber, #39314) [Link] (1 responses)

What API/ABI contract?

The kernel promises not to die unless PID 1 dies (or a bug happens or your block device dies or...). But unless your distro promises to survive a SIGKILL to all processes, I think you're on your own if you try that.

How Debian managed the systemd transition

Posted Sep 17, 2015 7:39 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

Classic SysV init and systemd survive mass process murder just fine.

How Debian managed the systemd transition

Posted Sep 19, 2015 14:13 UTC (Sat) by cortana (subscriber, #24596) [Link] (1 responses)

You can't send SIGKILL to dbus-daemon on a normal system and expect anything that uses dbus to behave sensibly however...

How Debian managed the systemd transition

Posted Sep 19, 2015 21:00 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

Certainly. But normal systems right now don't have DBUS as their critical component.

How Debian managed the systemd transition

Posted Sep 17, 2015 8:02 UTC (Thu) by fishface60 (subscriber, #88700) [Link]

Interestingly, it can (sort of).

If you do an exec() and it fails from some corruption of the page tables, or the executable at the wrong time without going through the file system (since you get -ETXTBUSY when trying to do anything with an executable file while a process is mid-exec on it), then the process is killed with an inescapable SIGKILL.

This is relevant for systemd, as there's a few circumstances where systemd will exec.

1. When shutting down it exec's systemd-shutdown, which primarily exists so that PID1 isn't holding files open and preventing a clean unmount.
Though a failure here is unlikely to ruin anyone's day too badly, since they were already shutting the box down, they just get a mystifying kernel stack trace on shutdown in the rare case where exec fails.
2. A suitably privileged user invokes `systemctl daemon-reexec`, which instructs systemd that it should serialise its state and exec itself again.
This is so that after a software update, systemd can use the new versions of dependent libraries, rather than the old ones that may have been removed, but systemd would still be holding open.
3. Privileged users may also request a `systemctl switch-root`, which is primarily intended for the initramfs transition, but could be used to move your rootfs to different storage (so long as you don't mind that most of your processes are killed).
In this case there's few processes hanging around to be able to break the executable mid-exec, but systemd supports the notion of "storage daemons", which are processes explicitly out of systemd's control, and are expected to have been exec'd from the initramfs.
If you are using a storage daemon to run a fuse-based rootfs then it could easily corrupt the executable mid-exec.


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