If the "forbiden" Library is just hidden or end in an error message is not the big point, because either way the library isn't accessable. So thats OK for me.
I agree the more difficult part is to ensure only one Calibre is accessing the library at the time.
I think I'll do it not controlling the library access, but ensure just one Calibre instance is running inside the LAN. First step ist to start the calibre via shellscript, which is started when clicking the programm (from menue and from desktop icon).
The Libraries are stored on an exported nfs dir.
The (calibre-) shell does the following on startup:
-checking if an nfs to the library dir mount exists
-if it does, finding out, which client/user compination uses it
(-perhaps sends a screen message to this user, gmessage is your friend)
-if no nfs mount exists
-mounting the nfs-dir (with success control)
-starting calibre
Now I just need a way to cleanly unmount the nfs-dir, when shutting down calibre.
or maybe I have to use an aoutomount to mount the nfs share.
EDIT
Alternativly I thought about searching for processes wit ps and grep to ensure no clibre process is running somewhere in the LAN.
/EDIT
Last edited by mclien; 09-28-2011 at 03:15 AM.
|