hive-matrix: turn off tuwunel's log preallocation on btrfs and zfs
Refs #6885
This commit is contained in:
parent
82710f4fa8
commit
7c7c94d184
1 changed files with 58 additions and 0 deletions
|
|
@ -945,6 +945,34 @@ let
|
|||
&& unit.serviceConfig.Group == "gateway-nginx"
|
||||
&& lib.elem dir unit.serviceConfig.ReadWritePaths;
|
||||
}
|
||||
{
|
||||
# tuwunel preallocates its logs unless told otherwise, which is only right
|
||||
# off btrfs and ZFS. The setting is decided when the unit starts: the
|
||||
# settings carry no `rocksdb_allow_fallocate`, a probe runs before
|
||||
# `ExecStart` and writes the override to a file the unit reads. The
|
||||
# container keeps the default start limit: a slow database open is not
|
||||
# answered with a longer one. `allow_registration` and `unix_socket_perms`
|
||||
# are the presence arms: settings read through the same path.
|
||||
name = "the homeserver turns log preallocation off at start, by a probe of its filesystem, and keeps the default start limit";
|
||||
ok =
|
||||
let
|
||||
host = serviceContainersWithCi;
|
||||
c = host.containers.hive-matrix;
|
||||
global = c.config.services.matrix-tuwunel.settings.global;
|
||||
unit = c.config.systemd.services.tuwunel;
|
||||
probe = lib.head unit.serviceConfig.ExecStartPre;
|
||||
in
|
||||
global ? allow_registration
|
||||
&& global ? unix_socket_perms
|
||||
&& !(global ? rocksdb_allow_fallocate)
|
||||
&& lib.length unit.serviceConfig.ExecStartPre == 1
|
||||
&& unit.serviceConfig.EnvironmentFile == [ "-/run/tuwunel/fallocate.env" ]
|
||||
&& unit.serviceConfig.RuntimeDirectory == "tuwunel"
|
||||
&& lib.hasInfix "stat -f -c %t /var/lib/tuwunel" probe.text
|
||||
&& lib.hasInfix "9123683e | 2fc12fc1) echo TUWUNEL_ROCKSDB_ALLOW_FALLOCATE=false > /run/tuwunel/fallocate.env" probe.text
|
||||
&& c.timeoutStartSec == "1min"
|
||||
&& startLimitOf "hive-matrix" == 60;
|
||||
}
|
||||
{
|
||||
# On the bridge by DHCP, with all three listeners on sockets: nothing
|
||||
# the bridge can dial. Every vhost location that forwards goes through
|
||||
|
|
|
|||
Loading…
Reference in a new issue