From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Tomas Szepe <szepe@pinerecords.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: how to restart userland?
Date: Mon, 3 Nov 2003 15:32:56 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0311031519050.2654@chaos> (raw)
In-Reply-To: <20031103193940.GA16820@louise.pinerecords.com>
On Mon, 3 Nov 2003, Tomas Szepe wrote:
> Hi,
>
> Would anyone know of a proven way to completely restart the userland
> of a Linux system?
>
> i.e. something like
> # echo whatever-restart >/proc/wherever
>
> Killing all processes.
> Killing init.
> Unmounting all filesystems.
> VFS: Mounted root (ext2 filesystem).
> INIT: v2.84 booting
> ...
>
> Thanks for any pointers,
> --
> Tomas Szepe <szepe@pinerecords.com>
> -
If you have an 'old' sys-V installation, you as root can execute
`init 0`. Then, after everything has stopped, you can execute
`init 5` or `init 6` to restart to the runlevel you had. More
modern versions from (probably all) distributions won't allow
this. But... you may be able to make a script. The problem is
in fooling init to start all over again. You really need to modify
init (perhaps runlevel 10) to, after everything is unmounted and
all the gettys are killed, do:
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.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
next prev parent reply other threads:[~2003-11-03 20:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-03 19:39 Tomas Szepe
2003-11-03 20:03 ` Valdis.Kletnieks
2003-11-03 20:12 ` Tomas Szepe
2003-11-04 10:05 ` Helge Hafting
2003-11-04 15:47 ` Thierry Vignaud
2003-11-03 20:21 ` Måns Rullgård
2003-11-03 20:31 ` Valdis.Kletnieks
2003-11-03 20:32 ` Richard B. Johnson [this message]
2003-11-03 20:41 ` Tomas Szepe
2003-11-03 21:00 ` Francois Romieu
2003-11-03 21:03 ` Francois Romieu
2003-11-03 21:12 ` Tomas Szepe
2003-11-03 23:32 ` Miquel van Smoorenburg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.53.0311031519050.2654@chaos \
--to=root@chaos.analogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=szepe@pinerecords.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®