public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Which process context does /sbin/hotplug run in?
@ 2006-05-12 18:20 Rob Landley
  2006-05-13  7:24 ` Kyle Moffett
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Landley @ 2006-05-12 18:20 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-15 22:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-12 18:20 Which process context does /sbin/hotplug run in? Rob Landley
2006-05-13  7:24 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox