linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Lennart Poettering <lennart@poettering.net>,
	Andrey Borzenkov <arvidjaar@mail.ru>,
	Tomasz Torcz <tomek@pipebreaker.pl>,
	systemd-devel@lists.freedesktop.org, linux-raid@vger.kernel.org
Subject: Re: [systemd-devel] systemd kills mdmon if it was started manually by user
Date: Tue, 25 Oct 2011 12:40:50 +1100	[thread overview]
Message-ID: <20111025124050.397c6546@notabene.brown> (raw)
In-Reply-To: <CAA9_cmfhUyenz2B1=wDsUtKcrj-5uOURproUemje37bPpM4-Qw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3919 bytes --]

On Sun, 23 Oct 2011 01:00:36 -0700 Dan Williams <dan.j.williams@intel.com>
wrote:

> On Tue, Feb 8, 2011 at 9:28 AM, Lennart Poettering
> <lennart@poettering.net> wrote:
> > On Tue, 08.02.11 16:54, Andrey Borzenkov (arvidjaar@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
> >> itself.
> >
> > 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
> >> use).
> >
> >
> > 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.
> 
> --
> Dan

Hi Dan,
  could you please explain in a bit more detail exactly what you think it is
  that is going wrong for you?

  I don't think it is anything like the original problem, as I don't think
  you are starting array manually.

  I think your problem is that 'mdmon' is being killed too early at shutdown.
  Clear we need to get whatever-kills-user-processes to skip mdmon - maybe by
  writing the pid to some magic file that 'ignore_proc' already knows about?

  Ultimately we probably want to get udev to start mdmon for us and have
  mdadm notice and not start it itself.
  We also need to get udev to notice arrays that are being reshaped and to
  start the mdadm which montiors the reshape so that mdadm doesn't have to
  fork it itself.

  That should fix the original problem, but I don't think it addresses your
  problem at all.

  I don't have a Fedora install so I cannot hunt around to see what is
  happening.

  I don't like the idea for a 'libmd.so' at all - certainly not until the
  problem is properly understood and other solutions (like running
  scripts) prove ineffective.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2011-10-25  1:40 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  8:41 systemd kills mdmon if it was started manually by user Andrey Borzenkov
2010-12-04  9:12 ` Christian Parpart
2010-12-04 12:08   ` Andrey Borzenkov
2010-12-12 13:20     ` [systemd-devel] " Luca Berra
2011-01-07  0:40     ` Lennart Poettering
     [not found]     ` <20101204121413.GC11336@mother.pipebreaker.pl>
     [not found]       ` <AANLkTi=nTSdHc55f08G9sdEK6u8eXp276VOTHHr0jmXT@mail.gmail.com>
     [not found]         ` <20110125034434.GC7046@tango.0pointer.de>
     [not found]           ` <AANLkTik189VTXYpzLFqP=MNBg=Nx-Yq6BOKURtiby++B@mail.gmail.com>
     [not found]             ` <20110125042814.GA9727@tango.0pointer.de>
2011-02-04 19:55               ` Andrey Borzenkov
2011-02-08  9:48                 ` [systemd-devel] " Lennart Poettering
2011-02-08 10:52                   ` Andrey Borzenkov
2011-02-08 11:07                     ` Lennart Poettering
2011-02-08 13:54                       ` Andrey Borzenkov
2011-02-08 17:28                         ` [systemd-devel] " Lennart Poettering
2011-10-23  8:00                           ` Dan Williams
2011-10-24  8:04                             ` Thomas Jarosch
2011-10-25  1:40                             ` NeilBrown [this message]
2011-10-31 11:06                             ` Lennart Poettering
2011-10-31 11:15                               ` [systemd-devel] " Lennart Poettering
2011-11-02  0:44                               ` NeilBrown
2011-11-02  1:16                                 ` Lennart Poettering
2011-11-02  2:03                                   ` NeilBrown
2011-11-02 13:32                                     ` Lennart Poettering
2011-11-02 14:33                                       ` Kay Sievers
2011-11-02 15:17                                         ` Lennart Poettering
2011-11-02 15:21                                           ` Kay Sievers
2011-11-02 15:29                                             ` [systemd-devel] " Lennart Poettering
2011-11-02 22:18                                               ` Williams, Dan J
2011-11-02 23:39                                                 ` Lennart Poettering
2011-11-03  0:28                                                   ` Williams, Dan J
2011-11-02 17:21                                           ` Williams, Dan J
2011-11-02 23:35                                             ` Lennart Poettering
2011-11-02 18:16                                         ` Williams, Dan J
2011-11-02 18:49                                           ` Kay Sievers
2011-11-02 19:31                                             ` Williams, Dan J
2011-11-02 19:51                                               ` Kay Sievers
2011-11-07  2:52                                       ` NeilBrown
2011-11-07  3:42                                         ` Kay Sievers
2011-11-07  4:30                                           ` NeilBrown
2011-11-07 12:00                                         ` Lennart Poettering
2011-11-07 19:09                                           ` Williams, Dan J
2011-11-08 14:43                                             ` Lennart Poettering
2011-11-08 23:27                                               ` Williams, Dan J
2011-11-08  0:11                                       ` Michal Soltys
2011-11-08 16:46                                         ` Michal Soltys
2011-11-08 20:32                                           ` Michal Soltys
2011-11-08 22:29                                             ` Williams, Dan J
2011-02-09 14:01                       ` Lennart Poettering
2011-01-07  0:38 ` Lennart Poettering
2011-01-07  1:09   ` [systemd-devel] " Michael Biebl
2011-01-07  1:17     ` Roman Mamedov
2011-01-07  1:16   ` NeilBrown
2011-01-07  1:42     ` Lennart Poettering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111025124050.397c6546@notabene.brown \
    --to=neilb@suse.de \
    --cc=arvidjaar@mail.ru \
    --cc=dan.j.williams@intel.com \
    --cc=lennart@poettering.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=tomek@pipebreaker.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).