From 0f07898dbbbe9c715525172a3e79e818134066cd Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 8 Nov 2020 18:13:51 +0100 Subject: [PATCH] Wait for the service starting up --- scripts/install | 8 +++----- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 9666a9d..ec69321 100644 --- a/scripts/install +++ b/scripts/install @@ -92,9 +92,8 @@ ynh_system_user_create --username=$app # Load services once to generate system.xml systemctl enable jellyfin -systemctl start jellyfin -sleep 5 -systemctl stop jellyfin +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app$(date "+%Y%m%d").log" --line_match="Startup complete" +ynh_systemd_action --service_name=$app --action="stop" # Port config ynh_replace_string --match_string="8096" --replace_string="$port" --target_file="/etc/jellyfin/system.xml" @@ -136,8 +135,7 @@ yunohost service add $app --description "Jellyfin media center" --log "/var/log/ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -sleep 5 +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app$(date "+%Y%m%d").log" --line_match="Startup complete" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 2943fc3..2b2ce8f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -107,7 +107,7 @@ yunohost service add $app --description "Jellyfin media center" --log "/var/log/ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app$(date "+%Y%m%d").log" --line_match="Startup complete" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index dd22913..ff41401 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,7 +103,7 @@ yunohost service add $app --description "Jellyfin media center" --log "/var/log/ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app$(date "+%Y%m%d").log" --line_match="Startup complete" #================================================= # RELOAD NGINX