Bug#324900: nscd: umount /var fails (unclean shutdowns)
- To: Gabor Gombas <gombasg@sztaki.hu>
- Cc: GOTO Masanori <gotom@debian.or.jp>, 324900@bugs.debian.org, Daniel Jacobowitz <drow@false.org>
- Subject: Bug#324900: nscd: umount /var fails (unclean shutdowns)
- From: Zlatko Calusic <zlatko.calusic@iskon.hr>
- Date: Mon, 05 Sep 2005 22:09:01 +0200
- Message-id: <[🔎] dnbr37i8f6.fsf@magla.zg.iskon.hr>
- Reply-to: zlatko.calusic@iskon.hr, 324900@bugs.debian.org
- In-reply-to: <20050831154820.GL12260@boogie.lpds.sztaki.hu> (Gabor Gombas's message of "Wed, 31 Aug 2005 17:48:20 +0200")
- References: <dnmzn6igzx.fsf@magla.zg.iskon.hr> <81hddewejl.wl%gotom@debian.or.jp> <dnbr3mnv3v.fsf@magla.zg.iskon.hr> <81d5o2vxxz.wl%gotom@debian.or.jp> <dnbr3mrp26.fsf@magla.zg.iskon.hr> <20050825215700.GA13316@nevyn.them.org> <81acj5wmko.wl%gotom@debian.or.jp> <20050826033154.GA20103@nevyn.them.org> <dnvf1tqb35.fsf@magla.zg.iskon.hr> <81k6i2vi2f.wl%gotom@debian.or.jp> <20050831154820.GL12260@boogie.lpds.sztaki.hu>
Gabor Gombas <gombasg@sztaki.hu> writes:
> Well, if /bin/sh is bash, then it is not weird at all, it is the same
> "bash vs. NSS" problem that came up several times in the past (last time
> quite recently on debian-devel). Previously it only happened with NSS
> modules that link to libraries under /usr, now it also affects nscd.
>
> What I _suspect_ is happening here:
>
> - by calling /etc/init.d/rc, bash is executed
> - bash unconditionally does some NSS calls during startup (getpwuid
> etc.); this in turn
> - loads all NSS modules that serve passwd maps -> if a module uses
> libraries from /usr, now you have a live memory mapping under /usr so
> you cannot unmount it during shutdown
> - bash (libc) connects to nscd
> - nscd sends a file descriptor of /var/db/nscd/passwd to bash, and bash
> does an mmap(2) on the received fd -> now you have a live memory
> mapping under /var thus you cannot unmount it during shutdown
> - /etc/init.d/rc eventually kills nscd but that does not help, since the
> bash process executing /etc/init.d/rc still has the cache file mapped
> (deleting the cache file also doesn't help since unlink(2) only
> operates on the directory and does not invalidate the memory mapping)
>
Yes, yes, yes. This is exactly what's happening and you explained it
so nicely I take my hat off and bow in front of you. :) THANKS!
At least we know now what we're dealing with here and I hope some of
your suggestions will be accepted to resolve this intricate problem.
--
Zlatko
Reply to: