16.12.2024 17:28, Tomasz Pala via Postfix-users wrote:
On 2024-12-16 10:36, Michael Tokarev via Postfix-users wrote:

Calling tzset() before chroot() is not useful in glibc.  Because while glibc
caches the /etc/localtime values to avoid the need to re-read it on each
use, it also *resets* the cached values back to defaults if it doesn't find
/etc/localtime on the next use.

Would storing the value in TZ variable before chroot() help dealing with
this?

Yes and no.  $TZ can be set to local time offset from UTC or a rule describing
such an offset -- TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0" (from man 3 
tzset).
With this, no /etc/localtime is considered.  Or TZ can point to a file, like
TZ=:Pacific/Auckland - in which case the value is read from
/usr/share/zoneinfo/Pacific/Auckland file, which is checked in chroot too.
I dunno if lack of this file in chroot will cause any issues though - but this
should be enough already to just copy /etc/localtime to the chroot and be done
with it (it's a small file which isn't updated often).

/mjt
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to