New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Logrotate did not generate the rotated log file

Started by gailclark80, September 20, 2025, 01:07:45 AM

Previous topic - Next topic

gailclark80

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?

overseer

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
}

gailclark80

#2
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?

rcschaff

Google Hangouts:  rcschaff82@gmail.com

gailclark80

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

rcschaff

Is selinux enabled or disabled on your server?  If it's enabled, it's probably your problem.
Google Hangouts:  rcschaff82@gmail.com