From b515e255d34c1a0d5f3243c45a9ad93dc8ecce85 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 26 Sep 2019 14:21:49 +0200 Subject: [PATCH] Fix that damn log issue --- scripts/install | 2 ++ scripts/upgrade | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 2e4922e..aa7de30 100644 --- a/scripts/install +++ b/scripts/install @@ -152,6 +152,8 @@ ynh_print_info "Configuring log rotation..." ### - And the section "SETUP LOGROTATE" in the upgrade script # Use logrotate to manage application logfile(s) +# We gotta create the file explicitly to avoid triggering https://github.com/YunoHost/issues/issues/1390 +touch "$final_path/data/log.txt" ynh_use_logrotate "$final_path/data/log.txt" diff --git a/scripts/upgrade b/scripts/upgrade index 9aa3b3c..3205547 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -130,7 +130,11 @@ ynh_print_info "Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) # Temporary fix for .txt log file and ynh_use_logrotate -ln -s "$final_path/data/log.txt" "$final_path/data/log.log" +if [ -d "$final_path/data/log.txt" ] +then + rm -r "$final_path/data/log.txt" + touch "$final_path/data/log.txt" +fi ynh_use_logrotate --non-append #=================================================