From: Andreas Schwab <schwab@suse.de>
To: kaih@khms.westfalen.de (Kai Henningsen)
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Q] pivot_root and initrd
Date: 05 Nov 2001 22:52:18 +0100 [thread overview]
Message-ID: <jeofmgsx65.fsf@sykes.suse.de> (raw)
In-Reply-To: <3BCDCF1D.6030202@usa.net> <8BfMOaZmw-B@khms.westfalen.de>
In-Reply-To: <8BfMOaZmw-B@khms.westfalen.de> (kaih@khms.westfalen.de's message of "27 Oct 2001 14:45:00 +0200")
kaih@khms.westfalen.de (Kai Henningsen) writes:
|> ebrower@usa.net (Eric) wrote on 17.10.01 in <3BCDCF1D.6030202@usa.net>:
|>
|> > You are simply doing the following, I assume with success:
|>
|> > exec /sbin/init "$@"
|>
|> > whereas I am doing something like the following:
|>
|> > exec chroot . sh -c 'umount $OLDROOT; exec -a init.new /sbin/init
|> > $INITARGS' <dev/console >dev/console 2>&1
|>
|> > I am mystified that the call to 'exec /sbin/init' works if you are using
|> > the standard (you mention "based on RedHat7.1" util-linux") /sbin/init
|> > proggie, and that a standard RH7.1 initscripts would not complain when
|> > the root filesystem is already mounted r/w.
|>
|> It works because the PID is 1, of course.
|>
|> /linuxrc (or however you call it) runs with PID=1, so when it exec's /sbin/
|> init, the PID is still 1.
|>
|> OTOH, you have chroot run a shell as a child, which therefore does *not*
|> have PID=1.
linuxrc does 'exec chroot', chroot does 'exec sh', sh does 'exec init'.
Thus init should end up with the same pid as linuxrc.
Andreas.
--
Andreas Schwab "And now for something
Andreas.Schwab@suse.de completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
next prev parent reply other threads:[~2001-11-05 21:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <p05100300b7f2b3b94b17@[10.128.7.49]>
2001-10-17 18:34 ` [Q] pivot_root and initrd Eric
2001-10-17 21:17 ` H. Peter Anvin
2001-10-27 12:45 ` Kai Henningsen
2001-11-05 21:52 ` Andreas Schwab [this message]
[not found] <p05100304b80cbe9cf127@[10.128.7.49]>
2001-11-06 0:05 ` Eric
[not found] <p05100328b7fb8dcb9473@[207.213.214.37]>
2001-10-23 21:54 ` Eric
2001-10-24 0:20 ` Werner Almesberger
2001-10-23 17:42 Eric
2001-10-23 18:14 ` H. Peter Anvin
2001-10-23 19:54 ` bill davidsen
2001-10-23 19:59 ` Rik van Riel
2001-10-23 20:21 ` bill davidsen
2001-10-23 21:00 ` H. Peter Anvin
2001-10-23 20:37 ` Werner Almesberger
2001-10-23 20:46 ` Richard B. Johnson
2001-10-23 20:52 ` H. Peter Anvin
2001-10-23 21:05 ` Richard B. Johnson
2001-10-23 21:06 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2001-10-17 2:16 Eric
2001-10-17 3:30 ` H. Peter Anvin
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=jeofmgsx65.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=kaih@khms.westfalen.de \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).