logrotate does not work for sssd_kcm, old logfile is still written to

Solution Unverified - Updated -

Issue

sssd_kcm is writing to the old log file after log file is rotated.

# ls -lh /var/log/sssd/
-rw------- 1 root root 1.7K 3月 2 13:59 sssd.log
-rw------- 1 root root 1.6K 2月 26 03:35 sssd.log.1
-rw------- 1 root root 483 2月 19 03:35 sssd.log.2.gz
-rw------- 1 root root 49K 3月 2 13:59 sssd_implicit_files.log
-rw------- 1 root root 33K 2月 24 12:15 sssd_implicit_files.log.1
-rw------- 1 root root 2.6K 2月 17 20:35 sssd_implicit_files.log.2.gz
-rw------- 1 root root   0 1月 29 03:09 sssd_kcm.log                    <-- this is not updated
-rw------- 1 root root 80G 3月 2 07:39 sssd_kcm.log.1                   <-- this is updated today
-rw------- 1 root root 78M 1月 24 08:10 sssd_kcm.log.2.gz
-rw------- 1 root root 2.6M 3月 2 14:22 sssd_nss.log
-rw------- 1 root root 505K 2月 26 03:35 sssd_nss.log.1
-rw------- 1 root root 77K 2月 19 03:35 sssd_nss.log.2.gz

The logrotate config:

$ cat  /etc/logrotate.d/sssd
/var/log/sssd/*.log {
    weekly
    missingok
    notifempty
    sharedscripts
    rotate 2
    compress
    delaycompress
    postrotate
        /bin/kill -HUP `cat /var/run/sssd.pid  2>/dev/null`  2> /dev/null || true
    endscript
}

Environment

  • Red Hat Enterprise Linux (RHEL) 8 and 9
  • sssd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content