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

[Nbd] nbd-client: small proposal for imporment



Here after a proposal for improvement of nbd-client usability in a thin client 
environment. 

Context: I am trying to use nbd for Linux disless station (using PXES on the 
client and SuSE 9.3 on the server) to access USB stick and CDROM. 
 - I use "subfs" automounter filesystem (on SuSE)
 - I hacked net-submount to become nbd-submount (use subfs for actual mount)
 - I use the standard Pxes on the client.

"subfs" works like a cheap automount, when user hit the mounting point it 
execute the submount command, and after XX second it try to unmount.
My nbd-submount command first start nbd-client, second do the actual mount. 
After XX second it try to umount and if unmount work it kill the nbd-client.

Technically you then only execute a command like following one in the XDM 
startup script to allow your user to access the local CD of a diskless 
station.
  > mount -t subfs -ofs=iso9660,ro,procuid,nosuid,nodev\ 
  > ,exec,iocharset=utf8,program=/sbin/nbd-submountd\
  > ,nb-host=lena,nb-port=9000 /dev/nb0 /media/lena-cd  

proposal for improvement:
----------------------------------------
In order my nbd-submount process to be able to kill the nbd-client you need to 
know the PID of the process and unfortunately nbd-client does not write any 
PID file. I see two options to slove this problem:

1: nbd-client to apply the same mechanism as nbd-server and write a PID file 
in "/var/run/nbd-client.MY-SOCK-NUM.pid"
2: nbd-client to have a --no-fork option that would allow nbd-submount to know 
which PID his process have.

I currently implemented the PID file, while --no-fork would be the best option 
for nbd-submount. I get the impression that having a pid file is more generic 
and would fit with more other requirements. Obviously having both would be 
perfect !!!

Fulup

PS: my source code is avaliable on http://fulup56.free.fr/nbd-submount/



Reply to: