Comment 2 for bug 621133

Revision history for this message
Maurits van Rees (maurits-vanrees) wrote :

Perhaps store the lockfile in the client home. Use:

os.environ.get('CLIENT_HOME')

In my case that gives '/Users/mauritsvanrees/buildout/singing-dancing-dev/var/instance'
I'm not sure if we mind that this means that two zeo clients could start sending out a newsletter at the same time, as they will have two separate lock files.

Including the current zope user (e.g. with os.getuid(), which in my case returns 501) in the lock file name sounds fine too. It does not solve the case of one zope user running multiple buildouts that use S&D, but that seems okay to me, though it may need a mention in some documentation, even if only in the HISTORY.txt

Current path might be tricky. At least os.getcwd() returns different directories, depending on where you are when you start the instance. And in a cron job, e.g. to restart the instance at reboot time, the current working directory is probably the root of the file system.