left4me: pin EnvironmentFile order via tuples (was sets)

Sets in libs/systemd.py:18 are sorted alphabetically. The current
output is correct by accident — host.env < web.env, host.env < /var.
Adding a third path later would silently reorder. Tuples preserve
insertion order; generate_unitfile() iterates them the same way.

Environment (HOME=, PATH=) stays a set: each line is an independent
KEY=VALUE assignment, order is irrelevant.
This commit is contained in:
CroneKorkN 2026-05-10 17:48:03 +02:00
parent 6965441e9a
commit 72da6c0a8d
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw

View file

@ -44,10 +44,10 @@ def systemd_units(metadata):
'HOME=/var/lib/left4me', 'HOME=/var/lib/left4me',
'PATH=/opt/left4me/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH=/opt/left4me/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}, },
'EnvironmentFile': { 'EnvironmentFile': (
'/etc/left4me/host.env', '/etc/left4me/host.env',
'/etc/left4me/web.env', '/etc/left4me/web.env',
}, ),
'ExecStart': ( 'ExecStart': (
'/opt/left4me/.venv/bin/gunicorn ' '/opt/left4me/.venv/bin/gunicorn '
f'--workers {workers} --threads {threads} ' f'--workers {workers} --threads {threads} '
@ -77,10 +77,10 @@ def systemd_units(metadata):
'Type': 'simple', 'Type': 'simple',
'User': 'left4me', 'User': 'left4me',
'Group': 'left4me', 'Group': 'left4me',
'EnvironmentFile': { 'EnvironmentFile': (
'/etc/left4me/host.env', '/etc/left4me/host.env',
'/var/lib/left4me/instances/%i/instance.env', '/var/lib/left4me/instances/%i/instance.env',
}, ),
'WorkingDirectory': '-/var/lib/left4me/runtime/%i/merged/left4dead2', 'WorkingDirectory': '-/var/lib/left4me/runtime/%i/merged/left4dead2',
'ExecStartPre': ( 'ExecStartPre': (
'+/usr/bin/nsenter --mount=/proc/1/ns/mnt -- ' '+/usr/bin/nsenter --mount=/proc/1/ns/mnt -- '