From 6e8233b9b0e0a9b59a3eff132af08ce3efdc7fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 7 Dec 2020 16:29:43 +0100 Subject: [PATCH] Standardize start systemd action and update uwsgi helper --- scripts/_common.sh | 2 +- scripts/change_url | 5 ++--- scripts/experimental_helper.sh | 14 +++++++++----- scripts/install | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index a8abe47..59afd95 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=/opt/yunohost/$app -pgadmin_user="pgadmin" +pgadmin_user="$app" python_version="$(python3 -V | cut -d' ' -f2 | cut -d. -f1-2)" dependances="python3-pip build-essential python3-dev python3-venv postgresql uwsgi uwsgi-plugin-python3 expect libpq-dev" diff --git a/scripts/change_url b/scripts/change_url index 424c73c..828f568 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -42,10 +42,9 @@ ynh_add_nginx_config ynh_add_uwsgi_service 'pgadmin_user python_version' # Reload services -ynh_script_progression --message="Reloading services..." -sudo systemctl reload nginx.service +ynh_script_progression --message="Restarting $app services..." --weight=3 ynh_systemd_action --service_name "uwsgi-app@$app.service" --action restart \ - --line_match "WSGI app 0 \(mountpoint='$path_url'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log" + --line_match "WSGI app 0 \(mountpoint='[/[:alnum:]_-]*'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/$app.log" sleep 10 ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 8aadcff..3b75020 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -9,22 +9,24 @@ ynh_check_global_uwsgi_config () { uwsgi --version || ynh_die --message="You need to add uwsgi (and appropriate plugin) as a dependency" cat > /etc/systemd/system/uwsgi-app@.service <