meson: add build option for /var/log mode

In Ubuntu, rsyslog is (a) part of the minimal image and (b) does not run
as root. To facilitate this, the rsyslog package configures /var/log
to be writeable by the syslog group.

There are currently conflicts in the Ubuntu packaging due to the way
tmpfiles are handled in package scripts: when systemd-tmpfiles is
invoked with both configurations (or for all configurations), things
work fine. But if invoked with only var.conf, which is the default case
for package upgrades, rsyslog is broken.

One suggestion to approach this was to make rsyslog's tmpfile
configuration use ACLs instead of trying to change the owning group and
directory mode. This can work, but since the ACL mask is stored in the
group permission bits, the effective mask for rsyslog becomes r-x again
when var.conf is invoked, because it sees that 0775 != 0755, and chmods
the directory.

Hence, for /var/log write permisssions to be extendable with ACLs,
the mode must be at least 0775. Rather than change the default,
add a build option to configure the /var/log mode.
This commit is contained in:
Nick Rosbrook
2026-07-28 21:23:18 +09:00
committed by Yu Watanabe
parent f2718dee52
commit f195b1c1a8
3 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ q /var 0755 - - -
L /var/run - - - - ../run
d /var/log 0755 - - -
d /var/log {{VAR_LOG_MODE}} - - -
{% if ENABLE_UTMP %}
f /var/log/wtmp 0664 root utmp -
f /var/log/btmp 0660 root utmp -