Skip to content

Commit 0ba94dc

Browse files
committed
dovecot: set TZ=:/etc/localtime to improve performance
1 parent d379fee commit 0ba94dc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cmdeploy/src/cmdeploy/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,13 @@ def _configure_dovecot(config: Config, debug: bool = False) -> bool:
410410
persist=True,
411411
)
412412

413+
timezone_env = files.line(
414+
name="Set TZ environment variable",
415+
path="/etc/environment",
416+
line="TZ=:/etc/localtime",
417+
)
418+
need_restart |= timezone_env.changed
419+
413420
return need_restart
414421

415422

cmdeploy/src/cmdeploy/tests/online/test_1_basic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ def test_opendkim_restarted(self, sshexec):
6565
assert (now - since_date).total_seconds() < 60 * 60 * 51
6666

6767

68+
def test_timezone_env(remote):
69+
for line in remote.iter_output("env"):
70+
print(line)
71+
if line == "tz=:/etc/localtime":
72+
return True
73+
pytest.fail("TZ is not set")
74+
75+
6876
def test_remote(remote, imap_or_smtp):
6977
lineproducer = remote.iter_output(imap_or_smtp.logcmd)
7078
imap_or_smtp.connect()

0 commit comments

Comments
 (0)