diff --git a/scripts/install b/scripts/install index 7738ec3..5e5191e 100644 --- a/scripts/install +++ b/scripts/install @@ -148,6 +148,11 @@ ynh_secure_remove --file="$final_path/installation" #================================================= ynh_script_progression --message="Configuring log rotation..." +mkdir -p "/var/log/$app" +chmod 750 "/var/log/$app" +chmod -R o-rwx "/var/log/$app" +chown -R $app:www-data "/var/log/$app" + # Use logrotate to manage application logfile(s) ynh_use_logrotate diff --git a/scripts/restore b/scripts/restore index 9b8b4d5..e29d747 100644 --- a/scripts/restore +++ b/scripts/restore @@ -98,6 +98,11 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Restoring the logrotate configuration..." +mkdir -p "/var/log/$app" +chmod 750 "/var/log/$app" +chmod -R o-rwx "/var/log/$app" +chown -R $app:www-data "/var/log/$app" + ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 76ee55f..baa2c71 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,6 +118,11 @@ chown $app:$app "$final_path/configuration.php" #================================================= ynh_script_progression --message="Upgrading logrotate configuration..." +mkdir -p "/var/log/$app" +chmod 750 "/var/log/$app" +chmod -R o-rwx "/var/log/$app" +chown -R $app:www-data "/var/log/$app" + # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append