[systemd-devel] systemd kills mdmon if it was started manually by user
dan.j.williams at intel.com
Sun Oct 23 01:00:36 PDT 2011
On Tue, Feb 8, 2011 at 9:28 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Tue, 08.02.11 16:54, Andrey Borzenkov (arvidjaar at mail.ru) wrote:
>> >> a) mdmon is perfectly capable of restarting, it is already used to
>> >> take over mdmon launched in initrd. The problem is to know when to
>> >> restart - i.e. when respective libraries are changed. This is a job
>> >> for package management in distribution. It is already employed for
>> >> glibc, systemd and some others and can just as well be employed for
>> >> mdmon. And this is totally unrelated to systemd :)
>> > Really, you are sying there is a synchronous way to make mdmon reexec
>> > itself? How does that work?
>> I am not sure whether it qualifies as synchronous, but "mdmon
>> --takeover" will kill any existing mdmon for this and start monitoring
> I wonder if this is really fully synchronous, i.e. that a) there is no
> point in time where mdmon is not running during this restart and b) the
> mdmom --takeover command returns when the new daemon is fully up, and
> not right-away.
>> > Well, the root file systems cannot be unmounted, only remounted.
>> > So, is there a way to invoke mdmon so that it flushes all metadata
>> > changes to disk and immediately terminates then this should be all we
>> > need for a clean solution. We'd then shutdown the normal instances of
>> > mdmon down like any other daemon and simply invoke this metadata
>> > flushing command as part of late shutdown.
>> Hmm ... it looks like you just need to
>> start mdmon
>> do mdadm --wait-clean
>> After this you can kill mdmon again (assuming decide is no more in
> Well, it would be nice if the md utils would offer something doing this
> without spawning multiple processes and killing them again.
/me wonders why his raid5 resyncs every boot on Fedora 15 and has
found this old thread.
I'm tempted to:
1/ teach ignore_proc() to scan for pid files in /dev/md/ (MDMON_DIR on Fedora)
2/ arrange for mdadm --wait-clean --scan to be called after all
filesytems have been mounted read only
...but a few things strike me. This does not seem to be what was
being proposed above. Systemd does not treat dm devices like a
service and takes care to shut them down explicitly (but in that case
there is an api that it can call). Is it time for a libmd.so, so
systemd can invoke the "--wait-clean --scan" process itself? Probably
simpler to just SIGTERM mdmon and wait for it.
More information about the systemd-devel