diff --git a/scripts/upgrade b/scripts/upgrade index c16f112..ca83245 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -228,14 +228,6 @@ pushd "$final_path" sudo -u $app env $ynh_node_load_PATH yarn install --production --pure-lockfile popd -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # SETUP SYSTEMD #================================================= @@ -254,6 +246,28 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app:$app $final_path +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Upgrading logrotate configuration..." + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $appyunohost service add $app --description "$app daemon for Peertube" --log "$datadir/logs/peertube.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" + #================================================= # SETUP SSOWAT #================================================= @@ -266,13 +280,6 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost" - #================================================= # RELOAD NGINX #=================================================