Closes: #278591 Patch from: Holger Weiss If you call logrotate once a week between 00:00 and 01:00 AM and daylight saving time is in effect, "weekly" rotations will be done only once in two weeks. E.g., the following crontab won't work as expected: 12 0 * * 1 /usr/sbin/logrotate logrotate uses the tm struct "lastRotated" in order to find out whether a logfile needs rotating. "lastRotated" is filled by first setting everything to zero, then setting the mday, month and year of the last rotation and then calling mktime(3) in order to normalize the rest of the struct. The problem is that if daylight saving time is in effect, mktime() will increment "lastRotated.tm_isdst" from 0 to 1 and push "lastRotated" by one hour. Hence, the current time will be compared with the day of the last rotation, 01:00 AM. This can be solved by setting lastRotated.tm_isdst correctly prior to the mktime() call. --- logrotate.c | 1 + 1 file changed, 1 insertion(+) Index: logrotate-3.7.1/logrotate.c =================================================================== --- logrotate-3.7.1.orig/logrotate.c +++ logrotate-3.7.1/logrotate.c @@ -78,6 +78,7 @@ static logState * findState(const char * states[i].lastRotated.tm_mon = now.tm_mon; states[i].lastRotated.tm_mday = now.tm_mday; states[i].lastRotated.tm_year = now.tm_year; + states[i].lastRotated.tm_isdst = now.tm_isdst; /* fill in the rest of the st->lastRotated fields */ lr_time = mktime(&states[i].lastRotated);