diff --git a/scripts/backup b/scripts/backup index 1e1a9da..b2063b0 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,9 +31,7 @@ domain=$(ynh_app_setting_get $app domain) db_name=$(ynh_app_setting_get "$app" psql_db) # Stop Plume for backup -systemctl stop "$app" -# App needs time to stop -sleep 10 +yunohost service stop "$app" #================================================= # STANDARD BACKUP STEPS @@ -83,12 +81,7 @@ ynh_backup "/etc/systemd/system/$app.service" #ynh_backup "/etc/cron.d/$app" #================================================= -# RELOAD NGINX +# START SERVICE #================================================= -systemctl reload nginx -systemctl enable "$app" -systemctl start "$app" -# App needs time to start -sleep 10 - +yunohost service start $app diff --git a/scripts/install b/scripts/install index fbba21e..9d98e60 100755 --- a/scripts/install +++ b/scripts/install @@ -241,9 +241,6 @@ fi # Create a dedicated systemd config ynh_add_systemd_config -systemctl enable "$app" -systemctl start "$app" -sleep 30 #================================================= # SETUP APPLICATION WITH CURL @@ -336,7 +333,7 @@ ynh_use_logrotate #yunohost service add $app --log "/var/log/$app/APP.log" # if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/APP.log" +yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/$app.log" #================================================= # SETUP SSOWAT @@ -355,6 +352,12 @@ fi systemctl reload nginx +#================================================= +# START SERVICE +#================================================= + +yunohost service start $app + #================================================= # SEND A README FOR THE ADMIN #================================================= diff --git a/scripts/remove b/scripts/remove index f89608d..4a97478 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,13 +23,6 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= # STANDARD REMOVE -#================================================= -# STOP AND REMOVE SERVICE -#================================================= - -# Remove the dedicated systemd config -ynh_remove_systemd_config - #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= @@ -42,6 +35,14 @@ then fi #================================================= +# STOP AND REMOVE SERVICE +#================================================= + +# Remove the dedicated systemd config +ynh_remove_systemd_config + +#================================================= + # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/restore b/scripts/restore index 76ae678..33a5adb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -72,6 +72,7 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name" # Create the dedicated user (if not existing) ynh_system_user_create $app "$final_path" + #================================================= # RESTORE USER RIGHTS #================================================= @@ -94,11 +95,6 @@ chown -R $app: $final_path # Define and install dependencies ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git curl gcc make openssl libssl-dev pkg-config sqlite3 libsqlite3-dev -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -#yunohost service add $app --log "/var/log/$app/APP.log" #================================================= # RESTORE SYSTEMD @@ -111,6 +107,12 @@ systemctl enable $app.service ( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm search unlock ) +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app --log "/var/log/$app/$app.log" + #================================================= # RESTORE THE CRON FILE #================================================= @@ -126,12 +128,16 @@ ynh_restore_file "/etc/logrotate.d/$app" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND START PLEROMA +# RELOAD NGINX AND PHP-FPM #================================================= +#systemctl reload php5-fpm systemctl reload nginx -systemctl enable "$app" -systemctl start "$app" -# App needs time to start -sleep 10 + +#================================================= +# START SERVICE +#================================================= + +yunohost service start $app + diff --git a/scripts/upgrade b/scripts/upgrade index 220d01e..6a09d93 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,7 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers - #================================================= # LOAD SETTINGS #================================================= @@ -67,7 +66,7 @@ ynh_clean_setup () { ynh_abort_if_errors # Stop Plume for upgrade -systemctl stop "$app" +yunohost service stop "$app" @@ -178,7 +177,10 @@ fi #================================================= systemctl reload nginx -systemctl enable "$app" -systemctl restart "$app" -# App needs time to start -sleep 10 + +#================================================= +# START SERVICE +#================================================= + +yunohost service start $app +