remove unix socket from pg

This commit is contained in:
2025-03-17 13:47:00 +04:00
parent 604660bff4
commit 3c6a6fc0b5

View File

@@ -87,7 +87,7 @@ in
)
// config
// {
unix_socket_directories = "@PGHOST@";
unix_socket_directories = "";
inherit port listen_addresses;
};
toStr =
@@ -113,7 +113,7 @@ in
runtimeInputs = [
package
pkgs.coreutils
pkgs.gnused
# pkgs.gnused
];
text = ''
POSTGRES_RUN_INITIAL_SCRIPT="false"
@@ -124,12 +124,12 @@ in
echo "PostgreSQL initdb process completed"
echo
fi
sed "s|@PGHOST@|''${PGHOST}|g" ${configFile} > "$PGDATA"/postgresql.conf
# sed "s|@PGHOST@|''${PGHOST}|g" ${configFile} > "$PGDATA"/postgresql.conf
if [[ "$POSTGRES_RUN_INITIAL_SCRIPT" == "true" ]]; then
echo
echo "PostgreSQL is setting up the initial database"
echo
pg_ctl -w start -o "-c unix_socket_directories=$PGHOST -c listen_addresses= -p ${builtins.toString port}"
pg_ctl -w start -o "-c unix_socket_directories='''' -c listen_addresses= -p ${builtins.toString port}"
pg_ctl -m fast -w stop
else
echo