Pending patches

Rob Landley rob at landley.net
Thu Oct 30 05:07:30 UTC 2008


On Wednesday 29 October 2008 07:04:50 Denys Vlasenko wrote:
> On Wed, Oct 29, 2008 at 7:48 AM, Vladimir Dronnikov <dronnikov at gmail.com> 
wrote:
> >> > +                       // umount -a
> >> > +                       // ???
> >> >
> >> > Do we really want to hard-reboot without remounting RO
> >> > or unmounting filesystems?
> >
> > I must expand "// ???" to be the real umounting. I got stuck here
> > hesitating whether to just spawn("umount -a") or try to reimplement
> > umount -a by hand...
>
> In this spot, don't you have a feeling that it's just _impossible_
> to devise a perfect reboot code *here*? Simply because
> you can't know what user might want to do before reboot.
> Should you try to free loop devices?

Nope, kernel does that.

> If not, unfreed loop devices 
> might prevent clean unmounts.

If so, that's a kernel bug.

> Should you send a message 
> to all logged-in consoles?

Historically optional behavior, and irrelevant to cleanly shutting down the 
system.  That's a userspace thing.

> What about not killing 
> openvpn tunnel carrying your NFS traffic *before*
> you try unmounting, as otherwise unmounting will fail,

Remember the whole thing about nfs is stateless?  (A stateless filesystem.  
Heh.)

> *and* many other things too because paging-in of executable
> pages will stop? There are so many different scenarios
> that you simply can't write code which will be good for them all.

People have been somehow getting by with init for 30 years.  This would seem 
to imply it can be done.

> The approach I advocate is - don't do it *here*.
>
> Here you need to only make sure that you do not screw up
> reboot by doing something silly (like exiting
> and making kernel oops). Everything else should be done
> by the reboot command (or most likely, it will be a shell script),
> not by init (process with PID 1).

Historically, Init calls a shutdown script to quiesce the system before 
actually shutting it down.

> Repeat after me - "reboot should be a reboot.sh".

Nope.

> Allow system admin to have a convenient place
> to tailor his reboot sequence to his needs.

Shutdown signals init, init has a script it can call to quiesce the system.

If you don't notify init not to respawn things, then your script will kill 
things and init will re-launch them and the system will never quiesce.  You 
have to coordinate a shutdown with PID 1, so it might as well be initiated by 
PID 1.

Rob



More information about the busybox mailing list