diff options
| author | yalh76 <yalh@yahoo.com> | 2019-04-06 16:08:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-06 16:08:48 +0200 |
| commit | bf9a8b1063ae3bcd8e96a2dd14dfb22a5af4bcfe (patch) | |
| tree | c3f01d8ac1be766d8af699c9cb195b3dcfa3ef9a /scripts/backup | |
| parent | 271a88b3f3494bf6910363ada845ad824295fc1d (diff) | |
| download | mastodon_ynh-bf9a8b1063ae3bcd8e96a2dd14dfb22a5af4bcfe.tar.gz mastodon_ynh-bf9a8b1063ae3bcd8e96a2dd14dfb22a5af4bcfe.tar.bz2 mastodon_ynh-bf9a8b1063ae3bcd8e96a2dd14dfb22a5af4bcfe.zip | |
Additional
* Implement ynh_systemd_action
* Implement ynh_add_secure_repos__3
Diffstat (limited to 'scripts/backup')
| -rw-r--r-- | scripts/backup | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/backup b/scripts/backup index c5a4702..58b29a7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -8,12 +8,16 @@ #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh +source ../settings/scripts/ynh_systemd_action source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ynh_clean_check_starting +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -31,12 +35,11 @@ db_name=$(ynh_app_setting_get $app db_name) #================================================= # STOP MASTODON SERVICES #================================================= -ynh_print_info "Stopping Mastodon Services..." - -yunohost service stop "$app-web" -yunohost service stop "$app-sidekiq" -yunohost service stop "$app-streaming" +ynh_print_info "Stopping Mastodon services..." +ynh_systemd_action --action=stop --service_name=${app}-web --line_match="Stopped" --log_path=systemd +ynh_systemd_action --action=stop --service_name=${app}-sidekiq --line_match="Stopped" --log_path=systemd +ynh_systemd_action --action=stop --service_name=${app}-streaming --line_match="Stopped" --log_path=systemd #================================================= # STANDARD BACKUP STEPS @@ -81,14 +84,11 @@ ynh_backup "/etc/cron.d/$app" #================================================= # START MASTODON SERVICES #================================================= -ynh_print_info "Starting Mastodon Services..." - -yunohost service start "$app-web" -yunohost service start "$app-sidekiq" -yunohost service start "$app-streaming" +ynh_print_info "Starting Mastodon services..." -# Waiting start all services -sleep 30 +ynh_systemd_action --action=start --service_name=${app}-web --line_match="Listening on tcp" --log_path=systemd +ynh_systemd_action --action=start --service_name=${app}-sidekiq --line_match="Starting processing" --log_path=systemd +ynh_systemd_action --action=start --service_name=${app}-streaming --line_match="Worker 1 now listening" --log_path=systemd #================================================= # END OF SCRIPT |
