From 30ba5a4a93e5fa0afaa09390a80d141c1def378e Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 2 Jun 2023 16:04:30 +0200 Subject: [PATCH] fix log path --- scripts/install | 6 +++--- scripts/restore | 6 +++--- scripts/upgrade | 13 +++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 42e1586..1fe62fc 100644 --- a/scripts/install +++ b/scripts/install @@ -161,9 +161,9 @@ popd #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on" -ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded" -ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening" +ynh_systemd_action --service_name=${app}-web --action="start" --log_path=/var/log/$app/$app-web.log --line_match="Listening on" +ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=/var/log/$app/$app-sidekiq.log --line_match="Schedules Loaded" +ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=/var/log/$app/$app-streaming.log --line_match="Worker 1 now listening" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index b1e86d6..d00613e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -90,9 +90,9 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_script_progression --message="Starting $app's service and reloading NGINX..." --weight=1 -ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on" -ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded" -ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening" +ynh_systemd_action --service_name=${app}-web --action="start" --log_path=/var/log/$app/${app}-web.log --line_match="Listening on" +ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=/var/log/$app/${app}-sidekiq.log --line_match="Schedules Loaded" +ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=/var/log/$app/${app}-streaming.log --line_match="Worker 1 now listening" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index bd313ea..15b260a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,6 +57,7 @@ fi # Rename the database to match packaging v2 defaults db_name if [[ $db_name = *'_production' ]]; then + # Logs from v1 are handled by systemd ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=systemd --line_match="Stopped" ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=systemd --line_match="Stopped" ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=systemd --line_match="Stopped" @@ -71,9 +72,9 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=systemd --line_match="Stopped" -ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=systemd --line_match="Stopped" -ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=systemd --line_match="Stopped" +ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=/var/log/$app/${app}-web.log --line_match="Stopped" +ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=/var/log/$app/${app}-sidekiq.log --line_match="Stopped" +ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=/var/log/$app/${app}-streaming.log --line_match="Stopped" #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) @@ -172,9 +173,9 @@ chown $app:$app "$config" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on" -ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded" -ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening" +ynh_systemd_action --service_name=${app}-web --action="start" --log_path=/var/log/$app/${app}-web.log --line_match="Listening on" +ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=/var/log/$app/${app}-sidekiq.log --line_match="Schedules Loaded" +ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=/var/log/$app/${app}-streaming.log --line_match="Worker 1 now listening" #================================================= # END OF SCRIPT