From 28d7b7db632d436deafea5263715487ef351a1a2 Mon Sep 17 00:00:00 2001 From: zamentur Date: Fri, 2 Oct 2015 19:46:18 +0200 Subject: [PATCH 1/4] [fix] Save and restore mysql password --- data/hooks/backup/{11-conf_mysql => 11-conf_ynh_mysql} | 0 data/hooks/restore/{11-conf_mysql => 11-conf_ynh_mysql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename data/hooks/backup/{11-conf_mysql => 11-conf_ynh_mysql} (100%) rename data/hooks/restore/{11-conf_mysql => 11-conf_ynh_mysql} (100%) diff --git a/data/hooks/backup/11-conf_mysql b/data/hooks/backup/11-conf_ynh_mysql similarity index 100% rename from data/hooks/backup/11-conf_mysql rename to data/hooks/backup/11-conf_ynh_mysql diff --git a/data/hooks/restore/11-conf_mysql b/data/hooks/restore/11-conf_ynh_mysql similarity index 100% rename from data/hooks/restore/11-conf_mysql rename to data/hooks/restore/11-conf_ynh_mysql From 04e9658f37f18423466db923006fb9012335b142 Mon Sep 17 00:00:00 2001 From: zamentur Date: Fri, 2 Oct 2015 20:09:28 +0200 Subject: [PATCH 2/4] [fix] Mysql backup in good directory --- data/hooks/backup/11-conf_ynh_mysql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/hooks/backup/11-conf_ynh_mysql b/data/hooks/backup/11-conf_ynh_mysql index d227df41d..e0cdc59ac 100644 --- a/data/hooks/backup/11-conf_ynh_mysql +++ b/data/hooks/backup/11-conf_ynh_mysql @@ -1,4 +1,4 @@ -backup_dir="$1/conf/mysql" +backup_dir="$1/conf/ynh/mysql" mkdir -p $backup_dir -mysqlpwd=$(sudo cat /etc/yunohost/mysql) +sudo cp -a /etc/yunohost/mysql $backup_dir/ From 027ec1697872889c2e74f4be379142a96ca38522 Mon Sep 17 00:00:00 2001 From: zamentur Date: Fri, 2 Oct 2015 20:48:04 +0200 Subject: [PATCH 3/4] [fix] error with slpacat and slapd-yuno.conf --- data/hooks/backup/05-conf_ldap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/hooks/backup/05-conf_ldap b/data/hooks/backup/05-conf_ldap index 0a6cbc443..1e405e696 100644 --- a/data/hooks/backup/05-conf_ldap +++ b/data/hooks/backup/05-conf_ldap @@ -1,7 +1,15 @@ backup_dir="$1/conf/ldap" mkdir -p $backup_dir +# Fix for first jessie yunohost where slapd.conf is called slapd-yuno.conf +# without slapcat doesn't work +if [ ! -f /etc/ldap/slapd.conf ] +then + sudo mv /etc/ldap/slapd-yuno.conf /etc/ldap/slapd.conf +fi + sudo cp -a /etc/ldap/slapd.conf $backup_dir/ + sudo slapcat -l $backup_dir/slapcat.ldif.raw egrep -v "^entryCSN:" < $backup_dir/slapcat.ldif.raw > $backup_dir/slapcat.ldif rm -f $backup_dir/slapcat.ldif.raw From 4357b936c3a769ca40ed0b4fe9f05ae0f3d7d06c Mon Sep 17 00:00:00 2001 From: zamentur Date: Fri, 2 Oct 2015 22:57:06 +0200 Subject: [PATCH 4/4] [fix] Restore mysql password from good directory --- data/hooks/restore/11-conf_ynh_mysql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/hooks/restore/11-conf_ynh_mysql b/data/hooks/restore/11-conf_ynh_mysql index cc1320298..bbea73fb1 100644 --- a/data/hooks/restore/11-conf_ynh_mysql +++ b/data/hooks/restore/11-conf_ynh_mysql @@ -1,5 +1,6 @@ -backup_dir="$1/conf/mysql" +backup_dir="$1/conf/ynh/mysql" service mysql restart +sudo cp -a $backup_dir/mysql /etc/yunohost/mysql mysqlpwd=$(sudo cat /etc/yunohost/mysql) sudo mysqladmin flush-privileges -p"$mysqlpwd"