문제 개요
logrotate[2848371]: error: failed to rename /usr/local/httpd2/logs/test.com-access_log to /usr/local/httpd2/logs/test.com-access_log-20260202: Read-only file system
logrotate[2848371]: error: failed to rename /usr/local/httpd2/logs/test.com-error_log to /usr/local/httpd2/logs/test.com-error_log-20260202: Read-only file system
logrotate[2848371]: error: error opening /usr/local/php/var/log/php-fpm.log: Read-only file system
logrotate[2848371]: error: error opening /usr/local/php/var/log/slow.log: Read-only file system
/var/log/dnf.log.4:2025-12-07T20:04:21+0900 DEBUG —> Package logrotate.x86_64 3.18.0-9.el9 will be upgraded
/var/log/dnf.log.4:2025-12-07T20:04:21+0900 DEBUG —> Package logrotate.x86_64 3.18.0-12.el9 will be an upgrade
/var/log/dnf.log.4:2025-12-07T20:04:21+0900 DEBUG —> Package systemd.x86_64 252-51.el9_6.3.rocky.0.1 will be upgraded
/var/log/dnf.log.4:2025-12-07T20:04:21+0900 DEBUG —> Package systemd.x86_64 252-55.el9_7.7.rocky.0.1 will be an upgrade
-rw-r–r– 1 root root 1682882 Dec 5 23:49 access_log-20251206-rw-r–r– 1 root root 1904115 Dec 6 23:54 access_log-20251207
-rw-r–r– 1 root root 54981516 Feb 2 21:08 access_log
[Service] ReadWritePaths=/usr/local/httpd2/logs ReadWritePaths=/usr/local/php/var/log
올바른 방법으로 수정하여, 위험 부담을 줄임
[Service]
ReadWritePaths=/usr/local/httpd2/logs
ReadWritePaths=/usr/local/php/var/log
systemctl edit logrotate
### Editing /etc/systemd/system/logrotate.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file[Service]
ReadWritePaths=/usr/local/httpd2/logs
ReadWritePaths=/usr/local/tomcat/logs
ReadWritePaths=/usr/local/php/var/log### Lines below this comment will be discarded
systemctl cat logrotate
systemctl daemon-reloadsystemctl restart logrotate
logrotate -f /etc/logrotate.conf
