diff --git a/data/hooks/conf_regen/34-mysql b/data/hooks/conf_regen/34-mysql index bda1859d8..5ee91827b 100755 --- a/data/hooks/conf_regen/34-mysql +++ b/data/hooks/conf_regen/34-mysql @@ -1,6 +1,7 @@ #!/bin/bash set -e +MYSQL_PKG="mariadb-server-10.1" do_pre_regen() { pending_dir=$1 @@ -31,19 +32,14 @@ do_post_regen() { "applications, and is going to reset the MySQL root password." \ "You can find this new password in /etc/yunohost/mysql." >&2 - # retrieve MySQL package provider - ynh_package_is_installed "mariadb-server-10.0" \ - && mysql_pkg="mariadb-server-10.0" \ - || mysql_pkg="mysql-server-5.5" - # set new password with debconf sudo debconf-set-selections << EOF -$mysql_pkg mysql-server/root_password password $mysql_password -$mysql_pkg mysql-server/root_password_again password $mysql_password +$MYSQL_PKG mysql-server/root_password password $mysql_password +$MYSQL_PKG mysql-server/root_password_again password $mysql_password EOF # reconfigure Debian package - sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1 + sudo dpkg-reconfigure -freadline -u "$MYSQL_PKG" 2>&1 else echo "It seems that you have already configured MySQL." \ "YunoHost needs to have a root access to MySQL to runs its" \ diff --git a/data/hooks/restore/11-conf_ynh_mysql b/data/hooks/restore/11-conf_ynh_mysql index 8b8438c0e..0aaaccd54 100644 --- a/data/hooks/restore/11-conf_ynh_mysql +++ b/data/hooks/restore/11-conf_ynh_mysql @@ -1,4 +1,5 @@ backup_dir="$1/conf/ynh/mysql" +MYSQL_PKG="mariadb-server-10.1" # ensure that mysql is running service mysql status >/dev/null 2>&1 \ @@ -23,19 +24,14 @@ sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || { "applications, and is going to reset the MySQL root password." \ "You can find this new password in /etc/yunohost/mysql." >&2 - # retrieve MySQL package provider - ynh_package_is_installed "mariadb-server-10.0" \ - && mysql_pkg="mariadb-server-10.0" \ - || mysql_pkg="mysql-server-5.5" - # set new password with debconf sudo debconf-set-selections << EOF -$mysql_pkg mysql-server/root_password password $new_pwd -$mysql_pkg mysql-server/root_password_again password $new_pwd +$MYSQL_PKG mysql-server/root_password password $new_pwd +$MYSQL_PKG mysql-server/root_password_again password $new_pwd EOF # reconfigure Debian package - sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1 + sudo dpkg-reconfigure -freadline -u "$MYSQL_PKG" 2>&1 } # store new root password diff --git a/debian/control b/debian/control index 6d8848e86..c60b62689 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Depends: ${python:Depends}, ${misc:Depends} , glances , dnsutils, bind9utils, unzip, git, curl, cron, wget , ca-certificates, netcat-openbsd, iproute - , mariadb-server | mysql-server, php-mysql | php-mysqlnd + , mariadb-server, php-mysql | php-mysqlnd , slapd, ldap-utils, sudo-ldap, libnss-ldapd, unscd , postfix-ldap, postfix-policyd-spf-perl, postfix-pcre, procmail, mailutils , dovecot-ldap, dovecot-lmtpd, dovecot-managesieved diff --git a/src/yunohost/data_migrations/0004_php5_to_php7_pools.py b/src/yunohost/data_migrations/0004_php5_to_php7_pools.py index 90023bcd4..b6a36e44b 100644 --- a/src/yunohost/data_migrations/0004_php5_to_php7_pools.py +++ b/src/yunohost/data_migrations/0004_php5_to_php7_pools.py @@ -48,6 +48,11 @@ class MyMigration(Migration): c = "sed -i '1i {}' {}".format(MIGRATION_COMMENT, dest) os.system(c) + # Some old comments starting with '#' instead of ';' are not + # compatible in php7 + c = "sed -i 's/^#/;#/g' {}".format(dest) + os.system(c) + # Reload/restart the php pools _run_service_command("restart", "php7.0-fpm") os.system("systemctl stop php5-fpm")