I basically have a web server for the site, and another that just stores files. The file server connects to the main one by installing one of its directories. Django is running on the website, so I mainly deal with python. Anyway, I seem to have encountered some problems when the files are reported as non-existent, even if they are actually there.
Essentially when I call
filepath = '/path/to/file/on/nfs/share'
exists = os.path.exists(filepath)
false exists even if the file really exists, and I know that this happens because I have timestamps printed in a log file that displays exactly when it was created. I'm not sure what might be the problem, but I know the docs for os.path.exists say
On some platforms, this function may return False if permission is not granted to execute os.stat () in the requested file, even if the path physically exists.
I know that this is not so, because the files have the same group and group number, which also has the same group numbers on both servers. Could this be an outdated cache or something like that?
My installation is done automatically through fstab.
Client side, the settings are:
filehost:/filefolder /localfolder nfs defaults,rsize=32768,wsize=32768
Server side, the settings are:
/filefolder webserver(rw,sync,no_root_squash,no_subtree_check)
Edit:
So, I think for more information / specifics. I am running a Python subprocess that generates a file in a remote directory. When the request is executed, it starts the subprocess and returns the expected location of the file.
The interface has a url that pings, where it calls os.path.exists () for this file, and when it loads the resource via ajax.
, , . , , , .
/ www-, , django. . , - , .