Hello,
I ran into some problems setting up wal-g
backup with postgresql
.
I eventually figured out the root cause to be an overly eager SystemCallFilter
in postgresql
’s systemd
service definition, which prevented wal-g
from doing setrlimit
syscall when it is run from postgres through the archive_command
.
This took a bunch of core dump investigations, running gdb
and reading a bunch of manpages about kernel syscalls.
I am new to nix, but this doesn’t feel like the experience I’ve had with other packaged software so far.
My sense is that I should write a PR to nixpkgs to fix this, but I have a few questions first:
- my feeling is that the
wal-g
package should fix this by changing the settings in postgresql’sserviceConfig
here, in a similar way to theopenFirewall
option in some services. - or is the opposite the way to go? have
postgresql
change its settings if some other package is installed. I see that it does so if various extensions (eg.citus
) are installed. Butwal-g
isn’t an extension, just a separate program which happens to work withpostgresql
. Which is the preferred way to solve this innixpkgs
? - I would love to take this as a learning exercise in contributing to
nixpkgs
, but is there an obvious example of a similar interaction between packages that I could use for inspiration? - As a side question, I fixed my config with
systemd.services.postgresql.serviceConfig.SystemCallFilter = [ "setrlimit" ];
but I can’t figure out why this adds aSystemCallFilter
line in the service definition, instead of replacing the setting altogether.
Thanks for any tips!