mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Create admin folder directly in slapd init
This commit is contained in:
parent
e8a625dba5
commit
c516cc8eb1
3 changed files with 3 additions and 25 deletions
|
@ -55,6 +55,9 @@ EOF
|
|||
chown -R openldap: /var/lib/ldap
|
||||
|
||||
nscd -i groups
|
||||
nscd -i passwd
|
||||
|
||||
mkhomedir_helper admin
|
||||
|
||||
systemctl restart slapd
|
||||
}
|
||||
|
|
|
@ -412,7 +412,6 @@
|
|||
"log_tools_upgrade": "Upgrade system packages",
|
||||
"log_tools_shutdown": "Shutdown your server",
|
||||
"log_tools_reboot": "Reboot your server",
|
||||
"ldap_init_failed_to_create_admin": "LDAP initialization could not create admin user",
|
||||
"mail_alias_remove_failed": "Could not remove e-mail alias '{mail:s}'",
|
||||
"mail_domain_unknown": "Invalid e-mail address for domain '{domain:s}'. Please, use a domain administrated by this server.",
|
||||
"mail_forward_remove_failed": "Could not remove e-mail forwarding '{mail:s}'",
|
||||
|
|
|
@ -281,7 +281,6 @@ def tools_postinstall(
|
|||
|
||||
# Update LDAP admin and create home dir
|
||||
tools_adminpw(password, check_strength=not force_password)
|
||||
_create_admin_home()
|
||||
|
||||
# Enable UPnP silently and reload firewall
|
||||
firewall_upnp("enable", no_refresh=True)
|
||||
|
@ -328,29 +327,6 @@ def tools_postinstall(
|
|||
logger.warning(m18n.n("yunohost_postinstall_end_tip"))
|
||||
|
||||
|
||||
def _create_admin_home():
|
||||
"""
|
||||
Create admin home dir
|
||||
"""
|
||||
|
||||
# Force nscd to refresh cache to take admin creation into account
|
||||
subprocess.call(["nscd", "-i", "passwd"])
|
||||
|
||||
# Check admin actually exists now
|
||||
try:
|
||||
pwd.getpwnam("admin")
|
||||
except KeyError:
|
||||
logger.error(m18n.n("ldap_init_failed_to_create_admin"))
|
||||
raise YunohostError("installation_failed")
|
||||
|
||||
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)
|
||||
|
||||
|
||||
def tools_regen_conf(
|
||||
names=[], with_diff=False, force=False, dry_run=False, list_pending=False
|
||||
):
|
||||
|
|
Loading…
Add table
Reference in a new issue