Re: [systemd-devel] systemd kills mdmon if it was started manually by user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11-11-02 14:32, Lennart Poettering wrote:
What we do right now is this:

kill_all_processes();
do {
      umount_all_file_systems_we_can();
      read_only_mount_all_remaining_file_systems();
} while (we_had_some_success_with_that());
jump_into_initrd();

As long as mdmon references a file from the root disk we cannot umount
it, so the loop wouldn't be effective.


I've peeked into systemd, and from what I can see, it /only/ jumps back to initramfs (prepare_new_root() and pivot_to_new_root()) if shutdown "binary" is present on initramfs. And whenever mdmon is still running or not, is not in any way determinent for pivot_root(2) call to succeed (or ... ?).

If /run/initramfs/shutdown is not present, then systemd just do the things the old way as far as I can see - it doesn't even attempt to pivot. And if it doesn't, the it can't umount the root (being itself tied to it) ?

So essentially, if systemd execs /shutdown (after pivoting to /run/initramfs) - then it's dracut's modules.d/99shutdown, which itself sources hooks from other modules to do the rest of cleaning job. And that should take care of all the remaining stuff (including terminating mdmon in graceful way, and then umounting /oldroot). Either way - pretty simple to add the necessary functionality to dracut.

So wouldn't simply a systemd's cgroup named say - immortals - with mdmon (by default) in it suffice ? Pivot back as usual, leave mdmon alive, let the dracut (or anything else used for initramfs) do the rest of the job (properly).


p.s.
Sorry if I missed something obvious, it was a quick and late peek over systemd's shutdown.c.
--
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


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux