diff --git a/data/helpers.d/apt b/data/helpers.d/apt index 194cae40f..ecad3b14a 100644 --- a/data/helpers.d/apt +++ b/data/helpers.d/apt @@ -261,6 +261,7 @@ ynh_install_app_dependencies() { dependencies+=", php${specific_php_version}, php${specific_php_version}-fpm, php${specific_php_version}-common" fi + local psql_installed2="$(dpkg --list | grep -q "ii *postgresql-$PSQL_VERSION" && echo yes || echo no)" # The first time we run ynh_install_app_dependencies, we will replace the # entire control file (This is in particular meant to cover the case of @@ -303,6 +304,14 @@ EOF # Set the default php version back as the default version for php-cli. update-alternatives --set php /usr/bin/php$YNH_DEFAULT_PHP_VERSION fi + + # Trigger postgresql regenconf if we may have just installed postgresql + local psql_installed2="$(dpkg --list | grep -q "ii *postgresql-$PSQL_VERSION" && echo yes || echo no)" + if [[ "$psql_installed" != "$psql_installed2" ]] + then + yunohost tools regen-conf postgresql + fi + } # Add dependencies to install with ynh_install_app_dependencies diff --git a/data/helpers.d/postgresql b/data/helpers.d/postgresql index 0e8d91936..563d3e7be 100644 --- a/data/helpers.d/postgresql +++ b/data/helpers.d/postgresql @@ -281,6 +281,8 @@ ynh_psql_remove_db() { # Create a master password and set up global settings # +# [internal] +# # usage: ynh_psql_test_if_first_run # # It also make sure that postgresql is installed and running