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

Francesco Frassinelli <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Message-ID <1375554808-12965-3-git-send-email-fraph24__20986.4273238511$1375554862$gmane$org@gmail.com>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.