On Friday 31 October 2008 20:15:08 Denys Vlasenko wrote:
> On Saturday 01 November 2008 01:58, Rob Landley wrote:
> > > > A process has a file open in it.  The filesystem is pinned until the
> > > > process closes that file, unless you want to force the unmount (so
> > > > the file starts getting a -ESOMETHINGOROTHER).
> > >
> > > This is not a problem.
> > > killall5 -KILL closes a lot of open files.
> >
> > If any of the ancestral processes that execed your shutdown thingy didn't
> > close a filehandle (and didn't set it close on exec), your shutdown thing
> > could itself have a file open and not know about it.  PID 1 has no
> > ancestors that have execed it, it came from the kernel.
>
> Is there not a way to close all filehandles
> you inherited from your parent?

Grovel around in /proc to see what they are, assuming /proc is mounted?  But 
it's more complicated than that:

http://lwn.net/Articles/236843/
http://lwn.net/Articles/237722/

When I say that signaling PID 1 so it can quiesce and shutdown the system for 
you is the easy way to do it right, I really am serious.  If you want to 
continue on after this one, we could start talking about how any use of the 
new container infrastructure prevents what you want to do from working 
properly.  (Go to http://lwn.net/Kernel/Index/ and search for "containers", 
there's a dozen or so articles on its development.)

Rob
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to