Which process context does /sbin/hotplug run in?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux