postgresql: Use runuser instead of sudo
Currently, sudo doesn't work in a NixOS container running inside a Nix build, because Nix's seccomp filter doesn't allow setuid programs. In any case, runuser is a bit lower-overhead than sudo.
This commit is contained in:
parent
9943fd1a1d
commit
b7ddd316f1
@ -343,7 +343,7 @@ in
|
|||||||
# Wait for PostgreSQL to be ready to accept connections.
|
# Wait for PostgreSQL to be ready to accept connections.
|
||||||
postStart =
|
postStart =
|
||||||
''
|
''
|
||||||
PSQL="${pkgs.sudo}/bin/sudo -u ${cfg.superUser} psql --port=${toString cfg.port}"
|
PSQL="${pkgs.utillinux}/bin/runuser -u ${cfg.superUser} -- psql --port=${toString cfg.port}"
|
||||||
|
|
||||||
while ! $PSQL -d postgres -c "" 2> /dev/null; do
|
while ! $PSQL -d postgres -c "" 2> /dev/null; do
|
||||||
if ! kill -0 "$MAINPID"; then exit 1; fi
|
if ! kill -0 "$MAINPID"; then exit 1; fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user