Bug 922844

Summary: rotatelogs %Z does not use correct timezone respecting DST
Product: Red Hat Enterprise Linux 6 Reporter: Luke Meyer <lmeyer>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED ERRATA QA Contact: Filip Holec <fholec>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: dkutalek, jkaluza, jorton, lmeyer, psplicha
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: httpd-2.2.15-40.el6 Doc Type: Bug Fix
Doc Text:
Previously, the rotatelogs utility did not correctly handle local time. Consequently, when using rotatelogs with a date format including "%Z", "%Z" was replaced by the timezone name, disregarding the daylight saving time. This bug has been fixed, and rotatelogs now expands the "%Z" variable in the date format correctly.
Story Points: ---
Clone Of:
: 1244545 (view as bug list) Environment:
Last Closed: 2015-07-22 05:52:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 921537, 1244545    
Attachments:
Description Flags
reproducer
none
proposed patch none

Description Luke Meyer 2013-03-18 16:28:54 UTC
Description of problem:
At least right now, when I direct rotatelogs to put the timezone in the log file name, it does not appear to notice that DST is in effect.

Version-Release number of selected component (if applicable):
httpd-2.2.15-26.el6.x86_64
tzdata-2012j-2.el6.noarch

How reproducible:
Always (at least for now)

Steps to Reproduce:
1. ln -sf  /usr/share/zoneinfo/US/Eastern /etc/localtime (other DST zones will do as well)
2. date
3. echo 1 | rotatelogs '/tmp/foo-%Y%m%d-%H%M%S-%Z' 60
4. ls /tmp/foo*
  
Actual results:
2. Mon Mar 18 12:25:06 EDT 2013
4. /tmp/foo-20130318-162500-EST

Expected results:
4. /tmp/foo-20130318-162500-EDT

Comment 1 Jan Kaluža 2013-10-10 12:30:18 UTC
Reassigning to "apr". It's apr_strftime problem.

Comment 2 Jan Kaluža 2013-10-10 12:30:57 UTC
Created attachment 810501 [details]
reproducer

Comment 4 Joe Orton 2013-10-10 16:05:58 UTC
Missed this one...

"rotatelogs -l" should do the right thing here.

Comment 5 Luke Meyer 2013-10-10 17:32:13 UTC
Hmm, that doesn't appear to help, sorry.

# ln -sf  /usr/share/zoneinfo/US/Eastern /etc/localtime
# date
Thu Oct 10 13:31:14 EDT 2013
# echo 1 | rotatelogs -l '/tmp/foo-%Y%m%d-%H%M%S-%Z' 60
# ls /tmp/foo*
/tmp/foo-20131010-133100-EST

Comment 6 RHEL Program Management 2013-10-13 23:47:47 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 Jan Kaluža 2013-10-15 07:33:03 UTC
Created attachment 812373 [details]
proposed patch

Comment 8 Joe Orton 2013-11-11 11:03:34 UTC
Fixed upstream:

http://svn.apache.org/r1532281
http://svn.apache.org/r1532289

Comment 14 errata-xmlrpc 2015-07-22 05:52:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1249.html