Page MenuHomeVyOS Platform

logrotate.service fails to start
Resolved (N/A)PublicBUG

Description

During boot the following can be seen flashing by:

[FAILED] Failed to start logrotate.service - Rotate log files.
See 'systemctl status logrotate.service' for details.

So I ran "systemctl status logrotate.service":

× logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static)
     Active: failed (Result: exit-code) since Fri 2023-08-04 08:27:59 CEST; 2min 8s ago
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
   Main PID: 833 (code=exited, status=3)
        CPU: 167ms

Aug 04 08:27:59 vyos systemd[1]: Starting logrotate.service - Rotate log files...
Aug 04 08:27:59 vyos logrotate[833]: error: state file /var/lib/logrotate/status is already locked
Aug 04 08:27:59 vyos logrotate[833]: logrotate does not support parallel execution on the same set of logfiles.
Aug 04 08:27:59 vyos systemd[1]: logrotate.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Aug 04 08:27:59 vyos systemd[1]: logrotate.service: Failed with result 'exit-code'.
Aug 04 08:27:59 vyos systemd[1]: Failed to start logrotate.service - Rotate log files.

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202308030317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

This comment was removed by c-po.
[email protected]:~$ systemctl list-timers
NEXT                         LEFT          LAST                         PASSED    UNIT                         ACTIVATES
Sat 2023-08-05 21:00:00 CEST 38min left    Sat 2023-08-05 20:00:01 CEST 21min ago logrotate.timer              logrotate.service

SO logrotate is executed once an hour by systemd - can you verify this issue persits after one hour has elapsed?

It seems happy for now:

root@vyos:/home/vyos# systemctl status logrotate.service
○ logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static)
     Active: inactive (dead) since Sat 2023-08-05 20:00:01 CEST; 59min ago
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
    Process: 2635 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=0/SUCCESS)
   Main PID: 2635 (code=exited, status=0/SUCCESS)
        CPU: 49ms

Aug 05 20:00:01 vyos systemd[1]: Starting logrotate.service - Rotate log files...
Aug 05 20:00:01 vyos systemd[1]: logrotate.service: Deactivated successfully.
Aug 05 20:00:01 vyos systemd[1]: Finished logrotate.service - Rotate log files.
root@vyos:/home/vyos# systemctl list-timers
NEXT                         LEFT          LAST                         PASSED        UNIT                         ACTIVATES                     
Sat 2023-08-05 22:00:00 CEST 58min left    Sat 2023-08-05 21:00:01 CEST 1min 1s ago   logrotate.timer              logrotate.service
Sun 2023-08-06 00:00:00 CEST 2h 58min left -                            -             dpkg-db-backup.timer         dpkg-db-backup.service
Sun 2023-08-06 00:09:31 CEST 3h 8min left  Sat 2023-08-05 14:25:39 CEST 6h ago        podman-auto-update.timer     podman-auto-update.service
Sun 2023-08-06 03:10:14 CEST 6h left       Fri 2023-08-04 08:38:31 CEST 1 day 12h ago e2scrub_all.timer            e2scrub_all.service
Sun 2023-08-06 20:10:03 CEST 23h left      Sat 2023-08-05 20:10:03 CEST 50min ago     systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2023-08-07 00:41:19 CEST 1 day 3h left Fri 2023-08-04 08:38:31 CEST 1 day 12h ago fstrim.timer                 fstrim.service

6 timers listed.
Pass --all to see loaded but inactive timers, too.

But I have rebooted the device several times since filing this bugreport.

Currently using VyOS 1.4-rolling-202308040317.

Lets keep this one open for some more time and see if the issue is resolved or not.

Seems to still be happy in VyOS 1.4-rolling-202308140557:

root@vyos:/home/vyos# systemctl status logrotate.service
○ logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static)
     Active: inactive (dead)
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
root@vyos:/home/vyos# systemctl list-timers
NEXT                         LEFT        LAST                         PASSED       UNIT                         ACTIVATES                     
Tue 2023-08-15 00:00:00 CEST 7min left   Mon 2023-08-14 23:00:01 CEST 52min ago    logrotate.timer              logrotate.service
Tue 2023-08-15 00:03:49 CEST 11min left  -                            -            systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Sun 2023-08-20 03:10:09 CEST 5 days left Mon 2023-08-14 22:20:55 CEST 1h 31min ago e2scrub_all.timer            e2scrub_all.service
Mon 2023-08-21 01:32:12 CEST 6 days left Mon 2023-08-14 22:20:55 CEST 1h 31min ago fstrim.timer                 fstrim.service

4 timers listed.
Pass --all to see loaded but inactive timers, too.
c-po closed this task as Resolved N/A.Aug 17 2023, 9:24 AM