reboot

Denis Vlasenko vda at ilport.com.ua
Mon Oct 17 09:31:33 UTC 2005


On Monday 17 October 2005 12:01, Rob Landley wrote:
> On Monday 17 October 2005 02:41, Denis Vlasenko wrote:
> > > > It's old System V way of doing thing, and it is _wrong_.
> > >
> > > So it should _not_ respawn mingetty on /dev/tty* when you exit?
> >
> > On my system supervise does it way better.
> 
> So you wrote a daemon to replace init because you don't like init.  Ok.

Almost. I had to debug few obscure bugs in util-linux's init,
produce patches and convince maintainer that the bug is real
(init calculated elapsed time incorrectly and was
wrongly concluding that getty's are respawining too fast,
leaving me with the system with no way to login).

After a few more buglets in util-linux I switched to daemontools.
 
> > I started from some router boxes, but then migrated all other boxes
> > under my control, including desktops, to this method of
> > spawning/controlling processes as it turned out to be much simpler.
> 
> You don't like to use init, therefore you don't use it.  Ok.
> 
> Busybox init should therefore behave differently, because you don't want to 
> use it.  I don't follow that part.

No, I don't say that bb init must behave differently, it's more like:

"bb reboot can be implemented so that it doesn't signal init for reboot,
it may signal init to stop respawning only, and do the rest of TERM/KILL/umount
sequence itself."

> If you don't configure init into busybox, then halt and reboot and such 
> shouldn't go through init restart the system.  This is currently the case.  
> (And if it's not working, that's a bug we should fix.)

Something like this, yes.

> > Let's imagine... hmm.. that I want to stop everything and go to singleuser
> > for filesystem repair.
> 
> init=/bin/sh

I meant, on a running system, without reboot.
 
> > # cd /var/service
> > # svc -d * */log; svc -u getty*
> >
> > Everything will stop, then only getty's will restart.
> 
> Actually on red hat "init 1" worked pretty well for me seven years ago.  Not 
> that this is an endorsement, but saying that your script works as well as a 
> seven year old Red Hat isn't either.

I just wanted to demonstrate how I would do that runlevel-like thing.
It need not to be ugly like it is in SysV init.

> > I am doing exactly this, and want to let people know that it actually
> > works rather nice. It's not a religious war, I am not trying
> > to "convert" you or everybody else.
> 
> I'm just trying to figure out what change you want to make to busybox, and not 
> particularly interested in a "gee, why do you all you crazy people use init, 
> what's wrong with you" digression.  You asked why it happened that way.  
> Computer history is a hobby of mine. :)
>
> If you don't build init into busybox, then the reboot and such utilities won't 
> call init.  I'm pretty sure this is documented somewhere, possibly not 
> prominently enough...

I think "reboot not going thru init" makes sense in any case (with or without init
compiled in). init just have to have a signal "hey please stop spawning getty's".
But in practice even without it, reboot will correctly do it's job
because repeatedly respawned getty's don't need root fs mounted r/w.

If someone starts their PostgreSQL db from init, *that* would be problematic :)
--
vda



More information about the busybox mailing list