On 02-10-13 09:04, Michal Belczyk wrote: > On Tue, Oct 01, 2013 at 04:27:14PM -0400, Paul Clements wrote: >>> Rather than looping over all nbd devices until I find one free to use, I >>> wondered if there's a way to immediately get the first free nbd device. >>> >> Also, the sysfs pid file is only present when the nbd is connected (i.e., >> an nbd-client is running): >> >> debian-i386~$ cat /sys/block/nbd5/pid >> 18172 >> >> debian-i386~$ ls -l /sys/block/nbd0/pid >> ls: cannot access /sys/block/nbd0/pid: No such file or directory > > This is exactly what nbd-client -c does, right?
Yes. It will output the PID if a device is connected, and exit nonzero if not. -- This end should point toward the ground if you want to go to space. If it starts pointing toward space you are having a bad problem and you will not go to space today. -- http://xkcd.com/1133/ ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ Nbd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nbd-general
