From owner-freebsd-questions@FreeBSD.ORG Fri Aug 7 15:37:09 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C999106564A for ; Fri, 7 Aug 2009 15:37:09 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 799018FC16 for ; Fri, 7 Aug 2009 15:37:09 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MZQpV-000BMB-H3; Fri, 07 Aug 2009 10:54:06 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id EA0BC32B35B6; Fri, 7 Aug 2009 10:54:00 -0400 (EDT) Message-ID: <4A7C4007.9000506@FreeBSD.org> Date: Fri, 07 Aug 2009 10:53:59 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Peter Steele References: In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) Cc: freebsd-questions@freebsd.org Subject: Re: How is time zone change signalled? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2009 15:37:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Steele wrote: [...] > > > The problem is with our C applications. They continue to operate with > the old time zone, so things like timestamps in log files are not in > sync with the timestamps in the Java app log files. If we stop and > restart the C apps they pick up the time zone change. However, we don't > want to take this extreme approach. We want the Java app to signal to > the C applications that the time zone has changed. However, I've > experimented with the various time zone related calls and I cannot > figure out what call is needed to make the C applications pick up the > time zone change. I've tried setting the environment variable TZ to the > new time zone and this doesn't seem to work, and I've tried calling > tzset() and tzsetwall(). In each case after I make these calls the > function "localtime()" does not return the same time base as the Java > application. > Hi Peter, Did you try unsetting TZ and then calling tzset()? The man page implies that doing so will force a reread of /etc/localtime (http://www.freebsd.org/cgi/man.cgi?query=tzset&sourceid=opensearch): "The tzset() function initializes time conversion information used by the library routine localtime(3). The environment variable TZ specifies how this is done. If TZ does not appear in the environment, the best available approximation to local wall clock time, as specified by the tzfile(5)-format file /etc/localtime is used." I haven't tested it, though, and I'm no timezone expert, so I may be completely off-base! Cheers, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKfEAG0sRouByUApARAkFQAKCq3PdqsoJ4aMMnNcoUgwHwOcOlLACfczQ/ vzfWIYV/n7TEgq6jIgCnVnE= =6Bwv -----END PGP SIGNATURE-----