bicep/{postgres,mysql}: bindmount data storage with noatime
#149
Reference in New Issue
Block a user
Delete Branch "bicep-dbms-noatime-bindmount"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes Drift/issues#387
bicep etter denne endringen basically:
noatimeAre the
RequiresMountsFornecessary? Isn't this already in place because of the dependency chain from the WorkingDirectory(https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#Implicit%20Dependencies) through the new bind mount unit?@@ -99,6 +99,18 @@ inmode = "0700";};fileSystems."/data/postgresql" = lib.mkIf cfg.enable {minor nit: move repeated string "/data/postgresql" into let-var "dataDir", like in mysql
I don't think
WorkingDirectoryis even set, but if it is thenWorkingDirectory=/var/lib/postgresqlwould be the correct value right? I'm not confident it follows the chain recursively all the way through/var/lib/postgresql->/data/postgresql->/data/postgresql->/data-> ... If it does, then it's not very obvious from the docs at least.The point where I think will fail would be the
/var/lib/postgresql->/data/postgresqljump, sinceRequiresMountsForexplicitly says that it is working with mount units. I have no idea ifBindPathsis built on invisible transient mount units or if it's a custom concept within the service logic. If it is the latter (and I expect it to be), thenWorkingDirectory(andRequiresMountsFor=/var/lib/postgresqlby proxy) would not be able to see this jump.The MySQL StateDirectory is /var/lib/mysql.
The PostgreSQL StateDirectory points to the specific versioned subdirectory of /var/lib/postgres.
The "Implicit Dependencies" of systemd.exec and systemd.mount seem to indicate that we get automatic dependencies on the state dir itself, and all parent directories required to mount it, but seemingly not if the "target" is a bind mount itself. IDK, the suggested change is probably fine, if we don't want to replace the BindPaths-thing entirely.
Approved if tested working >:)