From b70cff29f78d1da4d2c48c93457b7c33db8e78b0 Mon Sep 17 00:00:00 2001 From: zamentur Date: Mon, 8 Feb 2016 22:39:17 +0100 Subject: [PATCH 1/2] [fix] Backup/restore without postinstall failed --- data/hooks/backup/40-conf_ynh_currenthost | 7 +++++++ data/hooks/restore/40-conf_ynh_currenthost | 1 + 2 files changed, 8 insertions(+) create mode 100644 data/hooks/backup/40-conf_ynh_currenthost create mode 100644 data/hooks/restore/40-conf_ynh_currenthost diff --git a/data/hooks/backup/40-conf_ynh_currenthost b/data/hooks/backup/40-conf_ynh_currenthost new file mode 100644 index 000000000..a91a50001 --- /dev/null +++ b/data/hooks/backup/40-conf_ynh_currenthost @@ -0,0 +1,7 @@ +backup_dir="$1/conf/ynh/" +backup_dir_legacy="$1/yunohost/" +sudo mkdir -p $backup_dir +sudo mkdir -p $backup_dir_legacy + +sudo cp -a /etc/yunohost/current_host $backup_dir +sudo cp -a /etc/yunohost/current_host $backup_dir_legacy diff --git a/data/hooks/restore/40-conf_ynh_currenthost b/data/hooks/restore/40-conf_ynh_currenthost new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/data/hooks/restore/40-conf_ynh_currenthost @@ -0,0 +1 @@ + From b2a2a05598468239af61f0fcb7492b9165dcf8b4 Mon Sep 17 00:00:00 2001 From: zamentur Date: Mon, 8 Feb 2016 22:41:55 +0100 Subject: [PATCH 2/2] [fix] Slapd.d directory was empty after restore --- data/hooks/restore/05-conf_ldap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/hooks/restore/05-conf_ldap b/data/hooks/restore/05-conf_ldap index 22867e6cc..c41020352 100644 --- a/data/hooks/restore/05-conf_ldap +++ b/data/hooks/restore/05-conf_ldap @@ -23,7 +23,8 @@ else # Regenerate the configuration rm -rf /etc/ldap/slapd.d/* - slaptest -u -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d + slaptest -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d + chown -R openldap:openldap /etc/ldap/slapd.d cp -rfp /var/lib/ldap.old/DB_CONFIG /var/lib/ldap # Import the database