From owner-freebsd-current@FreeBSD.ORG Tue Nov 11 19:46:31 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DC084F5; Tue, 11 Nov 2014 19:46:31 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 3855924B; Tue, 11 Nov 2014 19:46:31 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id B8F615A9F0C; Tue, 11 Nov 2014 19:46:30 +0000 (UTC) Date: Tue, 11 Nov 2014 19:46:30 +0000 From: Brooks Davis To: John Baldwin Subject: Re: Changing timezone without reboot/restarting each service? Message-ID: <20141111194630.GC11089@spindle.one-eyed-alien.net> References: <5460B143.6080206@FreeBSD.org> <201411111357.40061.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <201411111357.40061.jhb@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-current@freebsd.org, lev@freebsd.org, FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 19:46:31 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 11, 2014 at 01:57:40PM -0500, John Baldwin wrote: > On Monday, November 10, 2014 7:36:19 am Lev Serebryakov wrote: > >=20 > > After changing timezones in Russia (with replacing /etc/localtime > > with new file), I found that cron works in "old" timezone till > > restart. And all other services do the same, but cron is most obvious > > here :) > >=20 > > Looks like libc reads timezone only once and it could not be chamged > > for process without restart (which leads to, effectivly, restart of > > whole server). > >=20 > > Is it known problem? I think, it should be fixed somehow. I > > understand, that re-check timezone file on each time-related call > > could be expensive, though :( >=20 > In practice, timezone changes are very rare, so rechecking the file is > quite expensive to do. I think having to restart processes is fine for t= his. For cron it seems like a neglegable cost as it has to check a file and a directory at each interval. For most other things it seems like a waste of resources to check. Even on systems like MacOS where this is solved better, lots of behavior is application dependent. For example, current versions of Omni Focus behave very oddly when the timezone changes underneath them. In practice you need to restart the application when timezones change (such as after a flight). Just making libc aware isn't a magic bullet. -- Brooks --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRiZ5YACgkQXY6L6fI4GtTp7gCeNUokksNWRSwGoC5V687AOMLJ y0cAn1Fm999Ua9pVEYbZ2A3stc2gfw6/ =OkpH -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--