Re: how to restart userland?

From: Tomas Szepe
Date: Mon Nov 03 2003 - 15:42:13 EST


On Nov-03 2003, Mon, 15:32 -0500
Richard B. Johnson <root@xxxxxxxxxxxxxxxxxx> wrote:

> char *argv[3];
> argv[0] ="/sbin/init";
> argv[1] ="auto";
> argv[2] = NULL;
> execve(argv[0], argv, __environ);
>
> That will overlay and restart init from scratch.

OK, that sounds like a plan. There's one problem, though -- I really need
to do this in a single step (i.e. I won't have console access to issue any
commands after all processes have been killed off and all the world's got
is a root shell), so the script mustn't get killed while the system is coming
down.

Thanks for help,
--
Tomas Szepe <szepe@xxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/