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

Jeroen van Meeuwen (Kolab Systems) vanmeeuwen at kolabsys.com
Mon Sep 9 22:32:25 CEST 2013


Hi Franceso,

I'm very sorry to get back to this only as late as I do now... My 
apologies. Thank you for the patch!

I would consider, that often the issue is that, while /dev/shm might be 
mounted, it might still not be mounted read-write.

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.

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.

On 2013-08-03 19:33, Francesco Frassinelli wrote:
> ---
>  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,

Kind regards,

Jeroen van Meeuwen

-- 
Systems Architect, Kolab Systems AG

e: vanmeeuwen at kolabsys.com
m: +44 74 2516 3817
w: http://www.kolabsys.com

pgp: 9342 BF08


More information about the devel mailing list