Control Web Panel
WebPanel => Problems on other RedHat linux servers => Topic started by: gailclark80 on September 20, 2025, 01:07:45 AM
-
Logrotate did not generate the rotated log file.
My config
AlmaLinux 9.6
CWP 0.9.8.1216
Contents of File: /etc/logrotate.d/sample.com.log
/usr/local/apache/domlogs/sample.com.log
{
missingok
daily
copytruncate
rotate 7
notifempty
}
However, this feature does not trigger automatically.
Manual triggering can generate new log files.
Why is this? How to automatically generate a new log file?
-
This is what I have for httpd logs, runs successfully on AlmaLinux 8 (as it did on CentOS 7 before):
/usr/local/apache/domlogs/*.log {
missingok
notifempty
sharedscripts
daily
rotate 7
postrotate
/sbin/service httpd reload > /var/log/httpd-rotate.log 2>&1 || true
endscript
compress
}
-
I checked the logrotate logs and found the following error:
error: error opening /usr/local/apache/domlogs/sample.com.log: Read-only file system
Then I checked the permissions and owner of this file. Its permissions are 644, and the owner is root. Both permissions and owner seem correct. Why is it still read-only?
-
What is the result of lsattr on the file?
-
This is the result of the command.
Command:lsattr /usr/local/apache/domlogs/sample.com.log
Result: --------------e------- /usr/local/apache/domlogs/sample.com.log
-
Is selinux enabled or disabled on your server? If it's enabled, it's probably your problem.