diff --git a/scripts/install b/scripts/install index 567d0a1..109500b 100755 --- a/scripts/install +++ b/scripts/install @@ -145,7 +145,9 @@ chmod 644 "/etc/cron.d/$app" #================================================= ynh_script_progression --message="Configuring log rotation..." --weight=1 -mkdir -p "/var/log/$app" +log_path="/var/log/$app" +mkdir -p $log_path +chown $app:www-data $log_path # Use logrotate to manage application logfile(s) ynh_use_logrotate diff --git a/scripts/restore b/scripts/restore index 1f98301..640fb9c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -108,7 +108,9 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 -mkdir -p "/var/log/$app" +log_path="/var/log/$app" +mkdir -p $log_path +chown $app:www-data $log_path ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6e16b9f..c018a2a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -167,7 +167,9 @@ fi #================================================= ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 -mkdir -p "/var/log/$app" +log_path="/var/log/$app" +mkdir -p $log_path +chown $app:www-data "$log_path" # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append