Commit b0642b80 authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: Switch mountpoints from /tmp/wcfs/* to /dev/shm/*

This way multiple zopes, which all have their own separate $TMP and $TMPDIR,
can still access shared WCFS instance. And new place fits naturally into
general wendelin.core logic (see added comment).
parent 10466457
......@@ -63,7 +63,7 @@ The following environment variables can be used to control wcfs.py client:
from __future__ import print_function, absolute_import
import os, sys, hashlib, tempfile, subprocess, time, stat
import os, sys, hashlib, subprocess, time, stat
import logging as log
from os.path import dirname
from errno import ENOENT, EEXIST
......@@ -310,8 +310,12 @@ def _mntpt_4zurl(zurl):
m = hashlib.sha1()
m.update(zurl)
# mkdir /tmp/wcfs with stiky bit. This way multiple users can create subdirectories inside.
wcfsroot = "%s/wcfs" % (tempfile.gettempdir())
# WCFS mounts are located under /dev/shm/wcfs. /dev/shm is already used by
# userspace part of wendelin.core memory manager from multiple processes.
# In a sense WCFS mount provides shared read-only memory backed by ZODB.
# mkdir /dev/shm/wcfs with stiky bit. This way multiple users can create subdirectories inside.
wcfsroot = "/dev/shm/wcfs"
wcfsmode = 0o777 | stat.S_ISVTX
if _mkdir_p(wcfsroot):
os.chmod(wcfsroot, wcfsmode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment