[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dbootstrap not respawned when killed



Erik Andersen wrote:
> On Fri Nov 12, 1999 at 03:56:14PM +0100, Eric Delaunay wrote:
> > 
> > When dbootstrap is killed (manually or automatically after a segfault or the
> > like), the first console is frozen.
> > It is because dbootstrap is spawn from /etc/init.d/rcS and this script is only
> > run once at boot time.
> > The solution is not to rerun rcS because it contains other commands but maybe
> > to support some kind of inittab or to hardcode dbootstrap as the first console
> > program in init like it was in slink.
> > I think we need dbootstrap to be respawn automatically after a kill for some
> > kind of robustness, especially on serial console where there is no shell
> > console to switch to to rerun dbootstrap by hand (it this case the system is
> > frozen and I have to reboot it wildly).
> > 
> > Erik, what do you think about this?
> 
> Ok.  Something like this:
>     for (;;) {
> 	...
>   
> 	if (pid1 == 0 && tty0_commands) {
>             pid1 = run(tty0_commands, console, wait_for_enter);
>         }
> 
> 	...
>  
>         if (wpid == pid1) {
>             if (run_rc == FALSE) {
>                 pid1 = 0;
>             }
>             else {
>                 run_rc=FALSE;
>                 wait_for_enter=TRUE;

Don't forget this line:
************************************
                  pid1 = 0
************************************

>     #ifdef DBOOTSTRAP
>                 tty0_commands= { "dbootstrap", "dbootstrap" 0};
>     #else
>                 tty0_commands=shell_commands;
>     #endif
>             }
>         }
> 
> 	...
> 
> 	sleep(1);
>     }
> ? so that the first time around we run the rc script,
> but all subsequent time around the loop we run dbootstrap?

Btw, it's fine to me.
Regards.

-- 
 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)


Reply to: