<div dir="ltr"><div><div><div><div>Hi Jeroen,<br></div>thanks for your reply.<br></div>/dev/shm is just a temporary space used in almost every Linux systems, mounted using a tmpfs with nosuid and noexec restrictions.<br>I found that in some modern distribution /dev/shm is just a standard directory kept for compatibility reasons, because it was moved to /run/shm. I agree that os.access('/dev/shm/', os.W_OK) is better than os.path.ismount('/dev/shm'), but it could not be enough for those newer systems. I propose to use this Python code: os.access('/dev/shm/', os.W_OK) or os.access('/run/shm/', os.W_OK)<br>
</div>I don't know why but in many OpenVZ VPS /dev/shm is not mounted automatically. I suppose that they prefer to keep it disabled for some security reasons (every user could use this space for writing) and let the system administrator mount it.<br>
</div><div><br><br></div>Kind regards,<br>Francesco Frassinelli<br><div><br><div><div><div><div><div><div><div class="gmail_extra"><div class="gmail_quote">2013/9/9 Jeroen van Meeuwen (Kolab Systems) <span dir="ltr"><<a href="mailto:vanmeeuwen@kolabsys.com" target="_blank">vanmeeuwen@kolabsys.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Franceso,<br>
<br>
I'm very sorry to get back to this only as late as I do now... My apologies. Thank you for the patch!<br>
<br>
I would consider, that often the issue is that, while /dev/shm might be mounted, it might still not be mounted read-write.<br>
<br>
That said, however, I'm uncertain whether an additional test for os.access('/dev/shm/', os.W_OK) would be appropriate, as I myself run no LXC/OpenVZ type of "virtual but not actually virtual" virtualization.<br>

<br>
If you could help me understand what this actually means / would actually do, I'd be more than happy to accept the patch and/or make the additional adjustments.<div><div class="h5"><br>
<br>
On 2013-08-03 19:33, Francesco Frassinelli wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 pykolab/setup/setup_ldap.py | 11 +++++++++++<br>
 1 file changed, 11 insertions(+)<br>
<br>
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py<br>
index 5d97bf2..d752b27 100644<br>
--- a/pykolab/setup/setup_ldap.py<br>
+++ b/pykolab/setup/setup_ldap.py<br>
@@ -20,6 +20,7 @@<br>
 import ldap<br>
 import ldap.modlist<br>
 import os<br>
+import platform<br>
 import pwd<br>
 import shutil<br>
 import subprocess<br>
@@ -348,6 +349,16 @@ ServerAdminPwd = %(admin_pass)s<br>
             subprocess.Popen(['kill', slapd_pid.read().rstrip()])<br>
         time.sleep(5)<br>
<br>
+    # Check if /dev/shm is mounted (Linux only)<br>
+    if platform.system() == 'Linux':<br>
+        if not os.path.ismount('/dev/shm'):<br>
+            print >> sys.stderr, utils.multiline_message(<br>
+                _("""<br>
+                        You need to mount /dev/shm.<br>
+                    """)<br>
+                )<br>
+            sys.exit(1)<br>
+<br>
     setup_389 = subprocess.Popen(<br>
             command,<br>
             stdout=subprocess.PIPE,<br>
</blockquote>
<br></div></div>
Kind regards,<br>
<br>
Jeroen van Meeuwen<span class=""><font color="#888888"><br>
<br>
-- <br>
Systems Architect, Kolab Systems AG<br>
<br>
e: vanmeeuwen at <a href="http://kolabsys.com" target="_blank">kolabsys.com</a><br>
m: <a href="tel:%2B44%2074%202516%203817" value="+447425163817" target="_blank">+44 74 2516 3817</a><br>
w: <a href="http://www.kolabsys.com" target="_blank">http://www.kolabsys.com</a><br>
<br>
pgp: 9342 BF08<br>
______________________________<u></u>_________________<br>
devel mailing list<br>
<a href="mailto:devel@lists.kolab.org" target="_blank">devel@lists.kolab.org</a><br>
<a href="https://lists.kolab.org/mailman/listinfo/devel" target="_blank">https://lists.kolab.org/<u></u>mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div></div></div></div></div></div></div></div></div>