On Wed, Nov 2, 2011 at 8:29 AM, Lennart Poettering <lennart@xxxxxxxxxxxxxx> wrote: > On Wed, 02.11.11 16:21, Kay Sievers (kay.sievers@xxxxxxxx) wrote: > >> >> On Wed, Nov 2, 2011 at 16:17, Lennart Poettering <lennart@xxxxxxxxxxxxxx> wrote: >> > Kernel threads we detect by checking whether /proc/$PID/cmdline is >> > empty, hence I'd suggest we use the first char of argv[0][0] here, to >> > detect whether something is a process to avoid killing. Question is >> > which char to choose for that. I am tempted to use '@'. >> >> Maybe introduce a 'initramfs' cgroup and move the pids there? > > Well, in which hierarchy? I am a bit concerned about having other > subsystems muck with the systemd cgroup hierarchy, before systemd has > set it up. > > I can see some elegance in having all code from the initrd that remains > running during boot in a cgroup of its own, but that's probably > orthogonal to finding a way to recognize processes not to kill at > shutdown. Why? Because there's stuff like Plymouth which also stays > around from the initramfs, but actually is something we *do* want to > kill on shutdown. So how about rather than binaries self modifying themselves as "please don't kill me" with argv[][], shutdown can just avoid process where /proc/$PID/cmdline starts with /run/initramfs? Then it's up to where the initramfs runs the binary to determine which instances it wants provenance over versus leaving to the init system. For manually started arrays maybe we should arrange for an initramfs-started-mdmon to spawn new instances for user started containers, rather than using the local /sbin/mdmon. Then the "mdadm -Ss" initiated by /run/initramfs/shutdown can reliably stop any md device regardless of how it was started. -- Dan -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html