From: Rob Landley <rob@landley.net>
To: linux-kernel@vger.kernel.org
Subject: Which process context does /sbin/hotplug run in?
Date: Fri, 12 May 2006 14:20:59 -0400 [thread overview]
Message-ID: <200605121421.00044.rob@landley.net> (raw)
Stupid question bout the interaction of initramfs, hotplug, and per-process
filesystem namespaces:
I do this from initramfs:
echo /sbin/mdev > /proc/sys/kernel/hotplug
At the moment I do that, the first "/" in /sbin/mdev points to rootfs.
Shortly thereafter I do a switch_root, which does a chroot. Does hotplug
still point into rootfs? Or does it point to whatever "/" for PID 1 points
to now?
Since every process could be in a different chroot environment, how do I know
which process context the kernel_thread that call_usermodehelper() runs in
was parented from? It seems random: the x86 implementation of
call_usermodehelper() is calling do_fork(), and seems to be using the
namespace of whatever process it's running in. Which could be a chroot
process that doesn't have the hotplug I pointed it at visible in its
namespace at all...
Anybody know this one? Now that filesystem namespaces are per-process, and
move/bind mounts let us have cycles in our trees, as far as I can tell we
could actually have two completely detached namespaces with different sets of
processes in each. A path to hotplug isn't
Rob
P.S: mount a filesystem under itself. Fun for the whole family:
mount -t tmpfs /tmp /tmp
cd /tmp
mkdir sub
mount --bind sub /var
cd /var
mkdir sub2
mount --move /tmp sub2
--
Never bet against the cheap plastic solution.
next reply other threads:[~2006-05-12 18:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-12 18:20 Rob Landley [this message]
2006-05-13 7:24 ` Which process context does /sbin/hotplug run in? Kyle Moffett
2006-05-15 0:08 ` Rob Landley
2006-05-15 4:17 ` Kyle Moffett
2006-05-15 4:28 ` Joshua Hudson
2006-05-15 19:59 ` Rob Landley
2006-05-15 22:22 ` Kyle Moffett
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=200605121421.00044.rob@landley.net \
--to=rob@landley.net \
--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