From f5697c0cdd847f443106e85d14d0e16aa855f8dd Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 13 Feb 2024 02:33:25 +0100 Subject: [PATCH] fix log folder perms --- scripts/install | 3 +++ scripts/restore | 3 +++ scripts/upgrade | 3 +++ 3 files changed, 9 insertions(+) diff --git a/scripts/install b/scripts/install index 73df670..e92be28 100755 --- a/scripts/install +++ b/scripts/install @@ -89,6 +89,9 @@ ynh_script_progression --message="Adding system configurations related to $app.. ynh_add_systemd_config yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965" +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + # Use logrotate to manage application logfile(s) ynh_use_logrotate diff --git a/scripts/restore b/scripts/restore index f98ec5b..31bdc39 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,9 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965" +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 178f2b5..673edf9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,9 @@ ynh_script_progression --message="Upgrading system configurations related to $ap ynh_add_systemd_config yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965" +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append