From: "W. Michael Petullo" <mike@flyn.org>
To: Ivan <pivo@pobox.sk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PID of init != 1 when initrd with pivot_root
Date: Tue, 5 Jun 2001 17:56:18 +0200 [thread overview]
Message-ID: <20010605175618.A2884@dragon.flyn.org> (raw)
In-Reply-To: <20010601040627.A1335@ivan.doma> <20010602220219.A1091@ivan.doma>
In-Reply-To: <20010602220219.A1091@ivan.doma>; from pivo@pobox.sk on Sat, Jun 02, 2001 at 10:02:19PM +0200
>>> Well, I upgraded and found pivot_root and the problem is that how do I make
>>> init run with PID 1. My linuxrc gets PID 7.
>>>
>>> 1 ? 00:03:05 swapper
>>> ...
>>> 7 ? 00:00:00 linuxrc
>>>
>>> init doesn't like running with any other PID than 1. I could probably revert
>>> to the not so old way of doing things and exit linuxrc and let the kernel
>>> change root. But then I wouldn't be able to mount root over samba :-(.
>>>
>>> ...
>> This is this way for backwards bug compatibility. Use the following
>> command line options to make it behave properly:
>>
>> ram=/dev/ram0 init=/linuxrc
> ...
>
> But the problem still remains. How do I make my /sbin/init run with PID 1
> using initial ramdisk under the new root change mechanism? I don't want to
> use the old change_root mechanism...
I had the same problem when doing some development for mkCDrec.
This project uses busybox, whose init does not run if its PID != 1.
I asked the busybox folks same question you did and never got a response.
As a kludge, and after looking at the busybox source code, I renamed init
to linuxrc. In this case the program is functionally equivalent to init,
except that it does not do the PID == 1 check.
An excerpt from my real linuxrc:
echo Pivot_root: my PID is $$
# exec /usr/sbin/chroot . /sbin/init < dev/console > dev/console 2>&1
# Okay, try this:
exec /usr/sbin/chroot . /sbin/linuxrc < /dev/console > /dev/console 2>&1
/sbin/linuxrc is actually init, renamed.
I am sure this is not the preferred method. Please let me know if you
find the correct solution.
--
W. Michael Petullo
:wq
next prev parent reply other threads:[~2001-06-05 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-01 2:06 PID of init != 1 when initrd with pivot_root Ivan
2001-06-01 4:11 ` H. Peter Anvin
2001-06-02 20:02 ` Ivan
2001-06-05 15:56 ` W. Michael Petullo [this message]
2001-06-05 19:36 ` Ivan Vadovic
2001-06-05 19:45 ` Kai Germaschewski
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=20010605175618.A2884@dragon.flyn.org \
--to=mike@flyn.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pivo@pobox.sk \
/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