in reply to Re^3: Other Script Processes
in thread Other Script Processes

Ok, so If I am updating the core file, vars.conf which has all that magic in it, then name it vars2.conf then just use unix to overwrite it and it should not interfere with users loading pages?

Is that correct?
thx,
Richard

Replies are listed 'Best First'.
Re^5: Other Script Processes
by ikegami (Patriarch) on Nov 17, 2007 at 02:56 UTC

    I believe so. Even if some processes have the file is open (say the perl parser), it's not a problem since the actual file on disk isn't changed. The perl accessing the old version of the file will continue to access the old version (which will get deleted once all file handles to it are closed). New perl instances will see the new file and open and parse that one.

    I'm assuming you're only reading from this file.

Re^5: Other Script Processes
by graff (Chancellor) on Nov 17, 2007 at 04:20 UTC
    If the core file is "vars.conf", you want to copy that to some other name (like "new-vars.conf"), alter the contents of that copy as needed, and when you are sure it is ready for use, just:
    mv new-vars.conf vars.conf
    (as a shell command) or just rename "new-vars.conf", "vars.conf" (as a step in a perl script -- same thing). That way, no one will ever get a partial (or partially edited) version of the file. Assuming the file is read only once per client process, there won't be any inconsistencies from the client's perspective.