Modify

Ticket #5896 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Allow NIS-format /etc/timezone

Reported by: dhighley@… Owned by: mdean
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords: timezone modify header
Cc: Ticket locked: no

Description

Running svn head 19027. All web pages are working but displaying the following errors. User Notice at /var/www/html/mythweb/includes/mythbackend.php, line 176: Failed to set php timezone to US/Pacific highley-recommened.com

Warning at /var/www/html/mythweb/includes/utils.php, line 163: Cannot modify header information - headers already sent by (output started at /var/www/html/mythweb/includes/errors.php:143)

Attachments

mythtv-5896-allow_NIS_format_etc_timezone.patch (2.0 KB) - added by sphery <mtdean@…> 4 years ago.
Allows the use of NIS-format /etc/timezone (in addition to Debian-format /etc/timezone)

Change History

comment:1 Changed 4 years ago by kormoc

  • Status changed from new to infoneeded_new

Please run the script found at http://svn.mythtv.org/trac/attachment/ticket/5319/myth_timezone.pl and post the output.

comment:2 Changed 4 years ago by dhighley@…

I'm running frontend and backend on Fedora 8. Results of script: Net::UPnP::ControlPoint? is not installed! Current Timezone Information

id: US/Pacific highley-recommened.com

offset: -28800

time: 2008-11-09T13:35:03

Changed 4 years ago by sphery <mtdean@…>

Allows the use of NIS-format /etc/timezone (in addition to Debian-format /etc/timezone)

comment:3 Changed 4 years ago by sphery <mtdean@…>

The patch mythtv-5896-allow_NIS_format_etc_timezone.patch adds a new function parse_zone_id_config_string() that parses the value read from /etc/timezone or /etc/sysconfig/clock to ensure the value used is a valid time zone ID in the zoneinfo database. This allows us to identify the time zone for users with NIS-format /etc/timezone files, which use the format:

[zone id] [host or NIS domain name] # optional comments

as opposed to the Debian-format /etc/timezone which contains only the zone ID.

Since whitespace may exist in the zone ID and the only delimiter between the zone ID and the NIS host/domain name is whitespace, parse_zone_id_config_string() just checks for a file in the zoneinfo DB whose name corresponds to the parsed value. If not found, it removes one word from the right of the string and tries again until it either finds a file or runs out of string.

The patch also modifies the regexp used in read_time_zone_id() to allow a hash/pound character in the line to begin a comment and ensures the comment is ignored. Also, whereas read_time_zone_id() used to blindly accept the value it read as a time zone ID, the new conditional (in the 3rd hunk) requires that the value correspond to a valid zone ID in the database, otherwise, we continue searching for the time zone ID.

comment:4 Changed 4 years ago by dhighley@…

Applied patch and confirm that it does fix the issue. Thanks

comment:5 Changed 4 years ago by kormoc

  • Owner changed from xris to ijr
  • Status changed from infoneeded_new to new
  • Component changed from mythweb to mythtv

comment:6 Changed 4 years ago by kormoc

  • Summary changed from More PHP web page display errors to Allow NIS-format /etc/timezone

comment:7 Changed 3 years ago by stuartm

  • Owner changed from ijr to stuartm
  • Status changed from new to accepted
  • Milestone changed from unknown to 0.22

comment:8 Changed 3 years ago by otto at kolsi dot fi

I have similar problem with freshly installed trunk on Fedora 10. In the machine /etc/sysconfig/clock contains:

# The ZONE parameter is only evaluated by system-config-date.
# The time zone of the system is defined by the contents of /etc/localtime.
ZONE="Europe/Helsinki"

Error in MythWeb is:

Failed to set php timezone to U

Running the Perl script gives:

$ ./myth_timezone.pl 
Use of uninitialized value $name in concatenation (.) or string at ./myth_timezone.pl line 44.
Current Timezone
  offset: UNKNOWN_COMMAND
    name: 

Tried to apply Sphery's attached patch but it doesn't seem to fix the issue for me.

comment:9 Changed 3 years ago by kormoc

(In [19553]) Re #5896, add in some extra debugging for the attempted timezone connection, and remove the cached value on an timezone set error

comment:10 Changed 3 years ago by stuartm

  • Owner stuartm deleted
  • Status changed from accepted to new

comment:11 Changed 3 years ago by mdean

  • Status changed from new to closed
  • Resolution set to fixed

(In [21338]) Allow NIS-format /etc/timezone in addition to Debian-format /etc/timezone

Fixes parsing of time zone ID when the system contains a NIS-format /etc/timezone, which contains extra information after the zone ID (hostname and possibly comments).

Closes #5896

comment:12 Changed 3 years ago by janne

  • Owner set to mdean
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.