On Tue, Jun 03, 2008 at 09:35:17PM +0100, Ceri Davies wrote: > On Tue, Jun 03, 2008 at 12:12:49PM -0700, Jordan Brown wrote: > > Ceri Davies wrote: > >> I'm completely with you. I'm suggesting that svc.startd is the best place > >> to put the hook rather than the kernel. > > > > The problem is that one of the very last things that is done before the > > system shuts down completely is that the file systems are fully sync'ed out > > and unmounted. For UFS at least, that has to happen before the power is > > removed. That final sync happens inside uadmin(2), inside the kernel. > > Hmm, the final sync of / may do, but by the time do_uadmin in svc.startd > calls uadmin(2) then all other filesystems are gone in which case there's > not much left for any UPS scripts to work with either.
But maybe local filesystems shouldn't "be gone" so much as re-mounted read-only. That's Jordan's insight, and it seems quite reasonable to me. Even NFS-mounted filesystems could stay, provided AUTH_NONE/SYS works, provided the network isn't torn down, and provided automountd isn't needed, though there's probably other dragons there. (Similarly with filesystems on iSCSI devices. Similarly for CIFS, supposing we had diskless CIFS clients :) Nico --