logrotate.service fails because it starts before winbind.service
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I have started to play with Prometheus on my Ubuntu 20.04.3. You can configure Prometheus to alert you when a systemd service fails, and in this way I noticed a problem with the logrotate.service immediately after booting the system.
I looked with Cockpit, and Cockpit was reporting logrotate.service as "Failed to start". This is the log for logrotate.service :
----8<-
Dez 09 08:00:56 rdiez3 systemd[1]: Starting Rotate log files...
Dez 09 08:00:58 rdiez3 logrotate[1760]: Can't find pid for destination 'winbindd'
Dez 09 08:00:58 rdiez3 logrotate[1069]: error: error running non-shared postrotate script for /var/log/
Dez 09 08:00:58 rdiez3 systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Dez 09 08:00:58 rdiez3 systemd[1]: logrotate.service: Failed with result 'exit-code'.
Dez 09 08:00:58 rdiez3 systemd[1]: Failed to start Rotate log files.
----8<-
I then looked at winbind.service , which was fine:
----8<-
Dez 09 08:01:01 rdiez3 systemd[1]: Starting Samba Winbind Daemon...
Dez 09 08:01:01 rdiez3 systemd[1]: Started Samba Winbind Daemon.
----8<-
But I noticed that winbind.service started after logrotate.service . I wonder whether this is a service dependency issue.
I am using this PC only during normal working hours, and logrotate.timer is set to run at midnight, when the computer will never be turned on.
The worry is that this problem could effectively cause the complete log rotation to stop working.
Status changed to 'Confirmed' because the bug affects multiple users.