From 7b308a0fc21b15c582b188c2d092029f8235870d Mon Sep 17 00:00:00 2001 From: kload Date: Thu, 1 Oct 2015 18:50:05 -0400 Subject: [PATCH] [fix] slapd configuration needed for postinstall --- data/hooks/conf_regen/06-slapd | 25 +++++++++++++++---------- debian/postinst | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/data/hooks/conf_regen/06-slapd b/data/hooks/conf_regen/06-slapd index b711ae0ba..2d3ef7f91 100644 --- a/data/hooks/conf_regen/06-slapd +++ b/data/hooks/conf_regen/06-slapd @@ -4,23 +4,28 @@ set -e force=$1 function safe_copy () { - if [[ "$force" == "True" ]]; then - sudo yunohost service safecopy \ - -s slapd \ - $1 $2 \ - --force + if [ ! -f /etc/yunohost/installed ]; then + sudo cp $1 $2 else - sudo yunohost service safecopy \ - -s slapd \ - $1 $2 + if [[ "$force" == "True" ]]; then + sudo yunohost service safecopy \ + -s slapd \ + $1 $2 \ + --force + else + sudo yunohost service safecopy \ + -s slapd \ + $1 $2 + fi fi } cd /usr/share/yunohost/templates/slapd # Remove legacy configuration file -sudo yunohost service saferemove -s slapd \ - /etc/ldap/slapd-yuno.conf +[ ! -f /etc/yunohost/installed ] \ + || sudo yunohost service saferemove -s slapd \ + /etc/ldap/slapd-yuno.conf safe_copy mailserver.schema /etc/ldap/schema/mailserver.schema safe_copy ldap.conf /etc/ldap/ldap.conf diff --git a/debian/postinst b/debian/postinst index c1159dfdc..b40c20c74 100644 --- a/debian/postinst +++ b/debian/postinst @@ -9,6 +9,7 @@ do_configure() { if [ ! -f /etc/yunohost/installed ]; then bash /usr/share/yunohost/hooks/conf_regen/01-yunohost bash /usr/share/yunohost/hooks/conf_regen/02-ssl + bash /usr/share/yunohost/hooks/conf_regen/06-slapd bash /usr/share/yunohost/hooks/conf_regen/15-nginx fi }