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/restore | |
| 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/restore')
| -rw-r--r-- | scripts/restore | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/scripts/restore b/scripts/restore index bfe6fbb..6e39fb5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -8,14 +8,18 @@ #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source /usr/share/yunohost/helpers source ../settings/scripts/ynh_install_ruby -source ../settings/scripts/ynh_add_secure_repos__2 +source ../settings/scripts/ynh_add_secure_repos__3 +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 @@ -78,8 +82,6 @@ chown -R $app: $final_path #================================================= ynh_print_info "Reinstalling dependencies..." -# TODO: add in a clean way backports and yarn - # Import debian archive pubkey, need on ARM arch arch=$(uname -m) if [[ "$arch" = arm* ]]; then @@ -96,12 +98,13 @@ ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" - # install nodejs ynh_install_nodejs 8 -# TODO: use the same mecanism with other files ynh_install_app_dependencies $pkg_dependencies +#================================================= +# INSTALLING RUBY AND BUNDLER +#================================================= ynh_install_ruby --ruby_version=2.6.0 - /opt/rbenv/versions/2.6.0/bin/gem update --system #================================================= @@ -144,13 +147,19 @@ ynh_restore_file "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND SERVICES +# START MASTODON SERVICES +#================================================= +ynh_print_info "Starting Mastodon services..." + +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 + +#================================================= +# RELOAD NGINX #================================================= -ynh_print_info "Reloading nginx web server and services..." +ynh_print_info "Reloading nginx web server..." -systemctl restart "$app-web" "$app-sidekiq" "$app-streaming" -# Waiting start all services -sleep 30 systemctl reload nginx #================================================= |
