[Kolab-devel] [PATCH 2/2] Check if /dev/shm is mounted (Linux only)

Francesco Frassinelli fraph24 at gmail.com
Sat Aug 3 20:33:28 CEST 2013


---
 pykolab/setup/setup_ldap.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 5d97bf2..d752b27 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -20,6 +20,7 @@
 import ldap
 import ldap.modlist
 import os
+import platform
 import pwd
 import shutil
 import subprocess
@@ -348,6 +349,16 @@ ServerAdminPwd = %(admin_pass)s
             subprocess.Popen(['kill', slapd_pid.read().rstrip()])
         time.sleep(5)
 
+    # Check if /dev/shm is mounted (Linux only)
+    if platform.system() == 'Linux':
+        if not os.path.ismount('/dev/shm'):
+            print >> sys.stderr, utils.multiline_message(
+                _("""
+                        You need to mount /dev/shm.
+                    """)
+                )
+            sys.exit(1)
+
     setup_389 = subprocess.Popen(
             command,
             stdout=subprocess.PIPE,
-- 
1.8.3.1



More information about the devel mailing list