Re: [PATCH] mdadm/systemd: remove KillMode=none from service file
From: Mariusz Tkaczyk <hidden>
Date: 2022-08-24 09:54:27
Hi Michal, Thank you for support. On Fri, 19 Aug 2022 00:00:47 +0200 Michal Koutný [off-list ref] wrote:
Hello. (Coming via https://lists.freedesktop.org/archives/systemd-devel/2022-August/048201.html.) On Tue, Aug 02, 2022 at 05:43:05PM +0200, Mariusz Tkaczyk [off-list ref] wrote:quoted
https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/tree/udev-md-raid-arrays.rules#n41 but i can't find wants dependency in: #systemctl show dev-md126.service #systemctl show dev-md127.serviceTypo here s/service/device/ But the Wants dependency won't help with shutdown ordering.quoted
I got: systemd[1]: /usr/lib/systemd/system/mdmon@.service:11: Failed to resolve unit specifiers in 'dev-%I.device', ignoring: Invalid slotWhat was your exact directive in service unit file and what was the template parameter? (This may not work though, since there'd be no stop job for .device unit during shutdown to order against. (not tested))
I removed those setting but it was something like: Before=initrd-switch-root.target dev-%I.device I can test more if you have suggestions.
quoted
Probably it tries to umount every exiting .mount unit, i didn't check deeply. https://www.freedesktop.org/software/systemd/man/systemd.mount.html I can see that we can define something for .mount units so I tried both: # mount -o x-systemd.after=mdmon@md127.service /dev/mapper/vg0-lvm_raid /mnt # mount -o x-systemd.requires=mdmon@md127.service /dev/mapper/vg0-lvm_raid /mnt but I doesn't help either. I seems that it is ignored because I cannot find mdmon dependency in systemctl show output for mnt.mount unit.These x-* options are parsed from fstab. If you mount manually like this, systemd won't learn about these non-kernel options (they don't get through /proc/mountinfo). Actually, I think if you add the .mount:After=mdmon@....service (via fstab), it should properly order the stop of mdmon after the particular unmount during shutdown.
Will check but it can be considered as workaround, not as a solution. VROC arrays are automatically configured in installers, also users may mount them manually, without any additional settings (as standalone disk). We need to resolve it globally. Thanks, Mariusz