This isn't the first time there's been a service that needs to run 
during shutdown, after other things have been shut down.  SunUC's 
automatic mechanisms for installing "single user" patches have roughly 
the same requirement, give or take exactly where during shutdown.  (I 
have never looked at that sequence in detail, but I have seen that it 
runs too early in shutdown.)

Assuming that SMF's shutdown operation is to stop every service, it 
seems like a "last minute" shutdown service would want to be depended on 
by everything else, so that everything else must shut down first.  (The 
mirror side of that is that it starts first, but since its start method 
would presumably be :true that doesn't seem like a problem.)

However, I suspect that for this particular operation (cutting power to 
the UPS) a kernel hook _is_ required.  I assume that when you cut power 
to the UPS, pretty much instantly the computer loses power.  That means 
it better happen after the final sync, which is down inside the kernel 
inside uadmin(2).  (Perhaps others realized this, but I don't see it 
clearly in the messages.)

Probably a ZFS-based system can survive a power failure.  A UFS-based 
system used to be able to, but at least the last time I checked was not 
able to: it often ended up with inconsistencies requiring a manual fsck.


Reply via email to