Hi!
I need help to fix that:
sudo systemctl status logrotate.service
● logrotate.service - Rotate log files
Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-03-20 10:05:39 CET; 22min ago
TriggeredBy: ● logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
Process: 2013 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
Main PID: 2013 (code=exited, status=1/FAILURE)
Mär 20 10:05:39 user systemd[1]: Starting Rotate log files...
Mär 20 10:05:39 user logrotate[2013]: error: error renaming temp state file /var/lib/logrotate/status.tmp
Mär 20 10:05:39 user systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Mär 20 10:05:39 user systemd[1]: logrotate.service: Failed with result 'exit-code'.
Mär 20 10:05:39 user systemd[1]: Failed to start Rotate log files.
How can I fix that error?
> logrotate[2013]: error: error renaming temp state file /var/lib/logrotate/status.tmp
What do you have for the following commands?
ls -ald /var/lib/logrotate
ls -al /var/lib/logrotate/
sudo touch /var/lib/logrotate/test
sudo rm -v /var/lib/logrotate/test
ls -ald /var/lib/logrotate
drwxr-xr-x 2 root root 0 Mär 20 10:56 /var/lib/logrotate
ls -al /var/lib/logrotate/
total 4
drwxr-xr-x 2 root root 0 Mär 20 10:56 .
drwxr-xr-x 65 root root 4096 Nov 29 17:30
sudo touch /var/lib/logrotate/test
sudo rm -v /var/lib/logrotate/test
removed '/var/lib/logrotate/test'
My logrotate.conf: (/etc/logrotate.conf)
weekly
su root adm
rotate 1
create
compress
include /etc/logrotate.d
maybee wrong permission "su root adm "?
Did a test: (before test, permission on /var/lib/logrotate was: root:adm )
Changed the folder /var/lib/logrotate
to root:root
rebooted.
then:
sudo systemctl status logrotate.service
● logrotate.service - Rotate log files
Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled)
Active: inactive (dead)
TriggeredBy: ● logrotate.timer
Docs: man:logrotate(8)
man:logrotate.conf(5)
sudo systemctl list-units --state=failed
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
Seems to be working now or?
mate2go:
to root:root
My 20.10 system has root root .
So you have fixed it
ok great
what about?
My logrotate.conf: (/etc/logrotate.conf)
weekly
su root adm
rotate 1
create
compress
include /etc/logrotate.d
Permission setting in the logrotate.conf "su root adm " is correct?
Yes, as the full configuration file /etc/logrotate.conf
has the following comment for this line:
# use the adm group by default, since this is the owning group
# of /var/log/syslog.
su root adm
ok, thanks for your help @ Norbert_X