Created attachment 216676 [details] Patch to add/set a user-configurable TZ env var At startup, rsyslogd emits: rsyslogd[8440] environment variable TZ is not set, auto correcting this to TZ=/etc/localtime [v8.2006.0 try https://www.rsyslog.com/e/2442 ] This patch sets TZ, defaulting to /etc/localtime. It also optionally allows the user to override it with rsyslogd_tz=".." in rc.conf. - Set TZ env var at launch - Bump PORTREVISION
Hi, rsyslog is complaining too much here. As tzset(3) says: ``` 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. ``` so this change is entirely cosmetic. However, I'm happy to implement this just to reduce the noise in log files. Mind you, rc.subr(8) already has a mechanism for setting the environment of commands: ``` ${name}_env A list of environment variables to run command with. This will be passed as arguments to the env(1) utility. ``` so let's use that.
Yup, it's purely cosmetic. Setting this via export seems better to me as it doesn't involve invoking an additional process. I'd still lean towards using export for that reason.
A commit references this bug: Author: matthew Date: Wed Jul 22 20:32:29 UTC 2020 New revision: 542893 URL: https://svnweb.freebsd.org/changeset/ports/542893 Log: Prevent rsyslogd from writing log messages about TZ being unset in the environment. This is a putely cosmetic change, as the default behaviour according to tzset(3) is: ``` 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. ``` Slightly modified from the patch supplied by zi to use the rc.subr(8) '${name}_env' variable. PR: 248185 Submitted by: zi Changes: head/sysutils/rsyslog8/Makefile head/sysutils/rsyslog8/files/rsyslogd.in
(In reply to Ryan Steinmetz from comment #2) One invocation of env(1) at the start of a long-running process like rsyslogd is hardly going to be measurable.
Committed, thanks!