From 519bcb9513596b2747467cc9c3a93cb6bfb19f50 Mon Sep 17 00:00:00 2001 From: Yalh Date: Thu, 24 Jan 2019 02:19:00 +0100 Subject: [PATCH] Reorder SystemD --- scripts/install | 6 ++++++ scripts/restore | 22 ++++++++++++---------- scripts/upgrade | 12 +++++++----- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/scripts/install b/scripts/install index 1a2c422..8058919 100755 --- a/scripts/install +++ b/scripts/install @@ -392,6 +392,12 @@ fi systemctl reload nginx +#================================================= +# START SERVICE +#================================================= + +yunohost service start $app + #================================================= # SEND A README FOR THE ADMIN #================================================= diff --git a/scripts/restore b/scripts/restore index de24e6c..7b1b750 100755 --- a/scripts/restore +++ b/scripts/restore @@ -118,18 +118,19 @@ sudo rm erlang_solutions.asc # install dependencies ynh_install_app_dependencies git build-essential postgresql postgresql-contrib openssl g++ apt-transport-https erlang-inets elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -yunohost service add $app --description "$app daemon for Pleroma" --log "/var/log/$app/$app.log" - #================================================= # RESTORE SYSTEMD #================================================= ynh_restore_file "/etc/systemd/system/$app.service" systemctl enable $app.service +systemctl daemon-reload + +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app --description "$app daemon for Pleroma" --log "/var/log/$app/$app.log" #================================================= # RESTORE THE CRON FILE @@ -151,7 +152,8 @@ ynh_restore_file "/etc/logrotate.d/$app" 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 ff93575..23786da 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,7 +69,7 @@ ynh_clean_setup () { ynh_abort_if_errors # Stop Pleroma for upgrade -systemctl stop "$app" +yunohost service stop "$app" #================================================= # CHECK THE PATH @@ -250,7 +250,9 @@ fi #================================================= systemctl reload nginx -systemctl enable "$app" -systemctl start "$app" -# App needs time to start -sleep 10 \ No newline at end of file + +#================================================= +# START SERVICE +#================================================= + +yunohost service start $app