[lkml]   [2001]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Q] pivot_root and initrd
Date (Kai Henningsen) writes:

|> (Eric) wrote on 17.10.01 in <>:
|> > 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 /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 Schwab "And now for something 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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:18    [W:0.084 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site