Delayed execution of external command

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

 



Hi,

        I was trying to create a bit unusual initrd and need to scan 
devices for 
LVM after they appear. This problem is that LVM tools can't scan just one 
device, but always scan all of them.

        Well, solution is simple, isn't it? Just run trigger, settle, 
vgchange 
and you are done... well, you are not. There are no guarantees devices 
will be in place when settle returns. It merely indicates empty queue, 
that may receive some more items a bit later. So what to do? Hook RUN to 
all block devices and run vgchange. Close, but still no good. It's not 
nice to scan all devices when one appears, is it?

        So... the best approach would IMO be creating /var/.../run-lvm-
please 
whenever a block device appears and then, after everything settles run lvm 
hook, which in turn triggers new block device found events, that gets 
processed... until everything is loaded and quiet.

        Plus I can configure network devices as they appear and start iscsi 
once 
they are up. And I will be busy-waiting in /init[1] until I get root, then 
just stop udev, pivot_root and resume event processing.

        And the question? How do I run a command every time queue hits 0 
items?
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux