diff --git a/scripts/backup b/scripts/backup index 839de19..0f1ed89 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting diff --git a/scripts/change_url b/scripts/change_url index b71033e..19f83af 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,7 +33,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #db_name=$(ynh_app_setting_get --app=$app --key=db_name) #db_user=$db_name #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) -port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -143,8 +142,10 @@ ynh_store_file_checksum --file="$config" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --action=start --service_name=$app --log_path=systemd --line_match="Started Distbin Service" -sleep 10 +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started Distbin Service" +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + sleep 60 +fi #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 31e0d95..b5ec2b6 100644 --- a/scripts/install +++ b/scripts/install @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting @@ -22,6 +23,7 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= +ynh_print_info --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH @@ -194,7 +196,7 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_print_info --message="Integrate service in YunoHost..." +ynh_print_info --message="Integrating service in YunoHost..." yunohost service add $app --description "$app daemon for distbin" --log "/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 5bd9758..58f38a3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,6 +25,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= +ynh_print_info --message="Removing service integration in YunoHost..." # 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 8666c8a..a6045d8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting @@ -67,7 +68,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # RESTORE USER RIGHTS #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_print_info --message="Restoring user rights..." # Restore permissions on app files chown -R "$app":"$app" "$final_path" @@ -102,9 +103,9 @@ systemctl enable $app.service #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_print_info --message="Advertising service in admin panel..." +ynh_print_info --message="Integrating service in YunoHost..." -yunohost service add $app --log "/var/log/$app/$app.log" +yunohost service add $app --description "$app daemon for distbin" --log "/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index b0ee263..744f2ba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,8 +98,9 @@ ynh_add_nginx_config #================================================= ynh_print_info --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies +ynh_remove_nodejs ynh_install_nodejs --nodejs_version="10" +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER @@ -136,6 +137,7 @@ fi ynh_print_info --message="Making upgrade..." chown -R "$app":"$app" "$final_path" + pushd $final_path ynh_use_nodejs sudo -u $app env PATH=$PATH npm install --ignore-scripts