[systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

Lennart Poettering lennart at poettering.net
Thu Oct 7 10:08:03 PDT 2010


On Wed, 06.10.10 15:43, Karel Zak (kzak at redhat.com) wrote:

> 
> On Wed, Oct 06, 2010 at 03:01:02PM +0200, Lennart Poettering wrote:
> > > > +                if (streq(mp->path, "/"))
> > > > +                        continue;
> > > > +
> > > > +                /* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
> > > > +                if (umount2(mp->path, MNT_FORCE) == 0)
> > > 
> > >  You have to execute things like /sbin/umount.<type> if you want to run your 
> > >  code on systems with NFS or cluster filesystems.
> > 
> > Can you elaborate on this? what does the umount.nfs tool do that matters
> 
>  I don't know and I don't care, the umount.<type> is supported API :-)

Hmm, note that we normally call /bin/umount for everything we
unmount. The code Gustavo and Fidencio prepared is simply the last
safety net for everything that might be left around by accident. As such
I believe it actually makes sense to go low-level here, since apparently
the high-level stuff failed if this code is even called. 

Or in other words: Gustavo's and Fidencio's code is just about enough to
avoid unclean file systems. If everything went correctly during normal
operation the usual ordered .mount units will aready have called
/bin/umount for all file systems.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list