Logrotate won't start

grandm1961

Verified User
Joined
Nov 30, 2020
Messages
69
Location
Wijhe
My log rotate won't start it gives an error and I just can't figure out why it doesn't.

this is what I am getting:
× logrotate.service - Rotate log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
Active: failed (Result: exit-code) since Wed 2026-01-14 11:39:18 CET; 11s ago
TriggeredBy: logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
Process: 46410 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
Main PID: 46410 (code=exited, status=1/FAILURE)
CPU: 25ms
Jan 14 11:39:18 server.duraweb.eu systemd[1]: Starting Rotate log files...
Jan 14 11:39:18 server.duraweb.eu logrotate[46410]: error: httpd:3 duplicate log entry for /var/log/httpd/access_log
Jan 14 11:39:18 server.duraweb.eu logrotate[46410]: error: found error in file httpd, skipping
Jan 14 11:39:18 server.duraweb.eu systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Jan 14 11:39:18 server.duraweb.eu systemd[1]: logrotate.service: Failed with result 'exit-code'.
Jan 14 11:39:18 server.duraweb.eu systemd[1]: Failed to start Rotate log files.

I have checked the logs, but all I see is attempts to hack my server and nothing out of the ordinary.
I have this in logrotate.d/apache
/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log /var/log/httpd/suexec_log /var/log/httpd/sulsphp_log /var/log/httpd/ssl_request_log {
missingok
sharedscripts
postrotate
/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}

/var/log/httpd/modsec_audit.log /var/log/httpd/modsec_debug.log {
missingok
notifempty
sharedscripts
copytruncate
postrotate
/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
maxsize 10M
}
this in log rotate.d/httpd
# Note that logs are not compressed unless "compress" is configured,
# which can be done either here or globally in /etc/logrotate.conf.
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
and this in log rotate.conf
# see "man logrotate" for details

# global options do not affect preceding include directives

# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# system-specific logs may be also be configured here.
here is my /usr/lib/systemd/system/logrotate.service
# hardening options
# details: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# no ProtectHome for userdir logs
# no PrivateNetwork for mail deliviery
# no NoNewPrivileges for third party rotate scripts
# no RestrictSUIDSGID for creating setgid directories
LockPersonality=true
MemoryDenyWriteExecute=true
PrivateDevices=true
PrivateTmp=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full
RestrictNamespaces=true
RestrictRealtime=true
I remember that when I setup this server I had selinux enabled and I remembered it to disable it for directadmin, might that be the problem?
And how to resolve this?
 
What will you get?

Code:
grep '/var/log/httpd/access_log'  /etc/logrotate.conf /etc/logrotate.d/*
I get this:
/etc/logrotate.d/apache:/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log /var/log/httpd/suexec_log /var/log/httpd/sulsphp_log /var/log/httpd/ssl_request_log {
 
Back
Top