diff --git a/scripts/backup b/scripts/backup index 4f2ed605..2bf2ed3c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/change_url b/scripts/change_url index 4a98a6ba..bd203702 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -125,7 +125,7 @@ popd #================================================= ynh_script_progression --message="Starting a supervisor service..." -ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" +ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 220eb980..49a53bca 100644 --- a/scripts/install +++ b/scripts/install @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -120,7 +120,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Installing composer dependencies..." -ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" +ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= # CREATE LOG FILE @@ -223,7 +223,7 @@ yunohost service add "supervisor" --description "Supervisor daemon for $app" --l ynh_script_progression --message="Starting a supervisor service..." # Start a supervisor service -ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" --line_match="Horizon started successfully" +ynh_supervisor_action --service_name="${app}-horizon" --action="reload" --log_path="systemd" --line_match="success: ${app}-horizon" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 44428a9a..e243477c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -137,7 +137,7 @@ yunohost service add "supervisor" --description "Supervisor daemon for $app" --l #================================================= ynh_script_progression --message="Starting a supervisor service..." -ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" +ynh_supervisor_action --service_name="${app}-horizon" --action="reload" --log_path="systemd" --line_match="success: ${app}-horizon" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index 3067ee47..4527df96 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # restore it if the upgrade fails ynh_restore_upgradebackup } @@ -115,7 +116,7 @@ if dpkg --compare-versions "0.10.9~ynh2" gt "$(ynh_read_manifest --manifest="/et ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf --others_var="phpversion" ynh_script_progression --message="Starting a supervisor service..." - ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" + ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon" fi if dpkg --compare-versions "0.10.9~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then @@ -138,7 +139,7 @@ fi #================================================= ynh_script_progression --message="Stopping a supervisor service..." -ynh_supervisor_action --service_name="${app}-horizon" --action="stop" --log_path="/var/log/$app/${app}-horizon.log" +ynh_supervisor_action --service_name="${app}-horizon" --action="stop" --log_path="systemd" --line_match="stopped: ${app}-horizon" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -193,7 +194,7 @@ ynh_script_progression --message="Updating php dependencies..." chown -R "$app": "$final_path" -ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="update" +ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="update" #================================================= # MODIFY A CONFIG FILE @@ -296,7 +297,7 @@ fi #================================================= ynh_script_progression --message="Starting a supervisor service..." -ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" +ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon" #================================================= # RELOAD NGINX diff --git a/scripts/ynh_composer__2 b/scripts/ynh_composer__2 index 762b7f7d..6f9676b5 100644 --- a/scripts/ynh_composer__2 +++ b/scripts/ynh_composer__2 @@ -20,7 +20,7 @@ ynh_composer_exec () { COMPOSER_HOME="$workdir/.composer" \ php${phpversion} "$workdir/composer.phar" $commands \ - -d "$workdir" --quiet --no-interaction + -d "$workdir" --no-interaction } # Install and initialize Composer in the given directory @@ -44,7 +44,7 @@ ynh_install_composer () { curl -sS https://getcomposer.org/installer \ | COMPOSER_HOME="$workdir/.composer" \ - php${phpversion} -- --quiet --install-dir="$workdir" \ + php${phpversion} -- --install-dir="$workdir" \ || ynh_die "Unable to install Composer." # update dependencies to create composer.lock diff --git a/scripts/ynh_supervisor b/scripts/ynh_supervisor index a44b66cb..340c13e9 100644 --- a/scripts/ynh_supervisor +++ b/scripts/ynh_supervisor @@ -118,9 +118,9 @@ ynh_supervisor_action() { then local templog="$(mktemp)" # Following the starting of the app in its log - if [ "$log_path" == "supervisor" ] ; then + if [ "$log_path" == "systemd" ] ; then # Read the supervisor journal - journalctl --unit=$service_name --follow --since=-0 --quiet > "$templog" & + journalctl --unit=supervisor --follow --since=-0 --quiet > "$templog" & # Get the PID of the journalctl command local pid_tail=$! else