On Saturday, December 04, 2010 09:41:26 am Andrey Borzenkov wrote: > If user starts array manually (mdadm -A -s as example) from within > user session and array needs mdmon, mdmon becomes part of user session > control group: > > â user > â â root > â â 1 > â â 1916 login -- root > â â 1930 -bash > â â 1964 gpg-agent --keep-display --daemon --write-env-file > /root/.gnup... â â 2062 mdmon md127 > > > It is then killed by systemd during shutdown as part of user session. > It results in dirty array on next boot. > > Is there any magic that allows daemon to be exempted from killing? While your raid should absolutely not be corrupted on next reboot when mdmon receives a SIGTERM, I suspect you're using pam_systemd.so (/etc/pam.d/system-auth), which automatically creates cgroups by login session, which in turn gets killed when the user has "completely logged out". That is why your mdadm gets terminated, too. You can avoid that by adding create-session=0 to it, like: # grep pam_systemd /etc/pam.d/systemd-auth session optional pam_systemd.so create-session=0 Which is the recommented way if you want processes (created by the "user") to live on even when this user has fully logged out. Regards, Christian Parpart. p.s.: see pam_systemd(8) -- 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