遇见鬼了,好好的日志切割服务挂了…..

这个问题产生的原因是硬盘满了 日志可能切割过程中满的 然后就触发文件系统变只读系统
导致日志服务异常退出, 但是没有恢复机制

[root@LAX ~]# systemctl status logrotate
× logrotate.service – Rotate log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
Active: failed (Result: exit-code) since Wed 2024-04-17 00:00:00 HKT; 23h ago
TriggeredBy: ● logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
Process: 62240 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
Main PID: 62240 (code=exited, status=1/FAILURE)
CPU: 25ms

Apr 17 00:00:00 LAX202 systemd[1]: Starting Rotate log files…
Apr 17 00:00:00 LAX202 logrotate[62240]: error: failed to rename /usr/local/nginx/logs/cdn_access.log to /usr/local/nginx/logs/cdn_access.log-20240417: Read-only file system
Apr 17 00:00:00 LAX202 systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Apr 17 00:00:00 LAX202 systemd[1]: logrotate.service: Failed with result ‘exit-code’.
Apr 17 00:00:00 LAX202 systemd[1]: Failed to start Rotate log files.
[root@LAX ~]# systemctl restart logrotate
[root@LAX ~]# systemctl status logrotate
○ logrotate.service – Rotate log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
Active: inactive (dead) since Wed 2024-04-17 23:54:24 HKT; 2s ago
TriggeredBy: ● logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
Process: 53552 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exit>
Main PID: 53552 (code=exited, status=0/SUCCESS)
CPU: 25ms

Apr 17 23:54:24 LAX202 systemd[1]: Starting Rotate log files…
Apr 17 23:54:24 LAX202 systemd[1]: logrotate.service: Deactivated successfully.
Apr 17 23:54:24 LAX202 systemd[1]: Finished Rotate log files.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注