27 Oct
2011
27 Oct
'11
3:51 a.m.
On Wed, Oct 26, 2011 at 07:12:13PM -0500, Dan McGee wrote: > On Wed, Oct 26, 2011 at 6:38 PM, Tom Gundersen <teg@jklm.no> wrote: > > udev was receiving some events (due to e.g. swapoff) on shutdown > > that caused it to fork new processes. These then receivde TERM before > s/received/ > > they could finish, and complained on the console. > > > > In principle, I'm worried that, with the right ammonut of bad luck, > s/amount/ > > we could fork off some process at exactly the wrong time which escapes > > the killall logic. > > > > This, by the way, highlights the frailty of the killall stuff. > Two quick thoughts here > 1. Is there a need to even call swapoff? I can't believe it is > essential for swap partitions. It unfortunately does makes sense for > swap files so we can later unmount the file system they live on, but > it looks like there is no way to differentiate. Dave, I know you want > to submit a patch to util-linux for this... :) I'm such a tool. Preliminary patchwork for this now exists: http://code.falconindy.com/cgit/util-linux.git/log/?h=swapon If anyone wants to give it a once over from a user or developer perspective, that'd be awesome. d > 2. Why do we do anything except unmounting filesystems after the > kill_all call? It seems like we could move the random seed, and > timezone set above it, and then kill udev, and then we'd be safe from > any and all spawned processes. > The only things following would be (hooks excluded) a umount call, > vgchange/cryptsetup calls, a mount call, and either poweroff/reboot. > That seems pretty easy to audit, and I feel like you took a potshot at > the killall thing when in fact udevd was the only bad boy in the > corner causing trouble. > > > > > Signed-off-by: Tom Gundersen <teg@jklm.no> > > --- > > rc.shutdown | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/rc.shutdown b/rc.shutdown > > index 8363737..5928b2d 100755 > > --- a/rc.shutdown > > +++ b/rc.shutdown > > @@ -19,6 +19,8 @@ run_hook shutdown_start > > > > stop_all_daemons > > > > +status "Shutting down UDev" udevadm control --exit > > + > > status "Deactivating Swap" swapoff -a > > > > # stop monitoring of lvm2 groups before unmounting filesystems > > -- > > 1.7.7.1 > > > >