From f95ae988cec3b155420e50658c92ae25bbcdbdd0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 27 Aug 2023 07:48:19 +0200 Subject: [PATCH] cleaning --- scripts/change_url | 2 +- scripts/install | 6 +++--- scripts/remove | 5 +++-- scripts/restore | 14 +++++++++----- scripts/upgrade | 6 +++--- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index f5cd86d..9779393 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,7 +30,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Updating systemd service..." --weight=1 -ynh_replace_string --match_string="Environment=ROOT_URL=https://$old_domain$old_path" --replace_string="Environment=ROOT_URL=https://$new_domain$new_path" --target_file="/etc/systemd/system/$app.service" +ynh_replace_string --match_string="Environment=ROOT_URL=https://$old_domain" --replace_string="Environment=ROOT_URL=https://$new_domain" --target_file="/etc/systemd/system/$app.service" systemctl daemon-reload #================================================= diff --git a/scripts/install b/scripts/install index b370abb..a08e12a 100644 --- a/scripts/install +++ b/scripts/install @@ -73,9 +73,9 @@ if ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.status())" | grep - fi #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -85,7 +85,7 @@ ynh_add_systemd_config # Use logrotate to manage application logfile(s) ynh_use_logrotate -yunohost service add $app --description="Team collaboration communication platform" +yunohost service add $app --description="Team collaboration communication platform" --log="/var/log/$app/$app.log" #============================================== # INSTALL ROCKETCHAT diff --git a/scripts/remove b/scripts/remove index 99d5c9a..7b007a9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,10 +18,11 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null diff --git a/scripts/restore b/scripts/restore index 30680e7..77d59f5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -64,9 +64,11 @@ if ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.status())" | grep - fi #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -75,12 +77,14 @@ systemctl enable $app.service --quiet ynh_restore_file --origin_path="/etc/logrotate.d/$app" -yunohost service add $app --description="Team collaboration communication platform" +yunohost service add $app --description="Team collaboration communication platform" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# GENERIC FINALIZATION #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=19 +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE +#================================================= +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING" diff --git a/scripts/upgrade b/scripts/upgrade index bfc0a40..a602c79 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,9 +97,9 @@ pushd $install_dir/programs/server popd #================================================= -# SETUP SYSTEMD +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -110,7 +110,7 @@ ynh_add_systemd_config # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -yunohost service add $app --description="Team collaboration communication platform" +yunohost service add $app --description="Team collaboration communication platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE