diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 75a27aa66..e341c76f1 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -104,6 +104,14 @@ def tools_ldapinit(): # Force nscd to refresh cache to take admin creation into account subprocess.call(['nscd', '-i', 'passwd']) + try: + # Attempt to create user home folder + subprocess.check_call(["mkhomedir_helper", "admin"]) + except subprocess.CalledProcessError: + if not os.path.isdir('/home/{0}'.format("admin")): + logger.warning(m18n.n('user_home_creation_failed'), + exc_info=1) + # Check admin actually exists now try: pwd.getpwnam("admin")