[bitnami/pgbouncer] Configure ownership for the socket directory (#81387)

Configure ownership for the socket directory

Signed-off-by: Nils Caspar <nils@outset.ai>
This commit is contained in:
Nils Caspar
2025-06-11 08:07:03 -07:00
committed by GitHub
parent 951dd3bf33
commit 6d56826052

View File

@@ -338,6 +338,12 @@ pgbouncer_initialize() {
# Configuring permissions for tmp and logs folders
am_i_root && configure_permissions_ownership "$PGBOUNCER_TMP_DIR $PGBOUNCER_LOG_DIR" -u "$PGBOUNCER_DAEMON_USER" -g "$PGBOUNCER_DAEMON_GROUP"
# Configure ownership and permissions for the socket directory if PGBOUNCER_SOCKET_DIR is set.
# This ensures the directory is usable by PGBOUNCER_DAEMON_USER, especially if it's a root-owned mount point.
if ! is_empty_value "$PGBOUNCER_SOCKET_DIR"; then
am_i_root && configure_permissions_ownership "$PGBOUNCER_SOCKET_DIR" -u "$PGBOUNCER_DAEMON_USER" -g "$PGBOUNCER_DAEMON_GROUP" --dir-mode "0755"
fi
# Avoid exit code of previous commands to affect the result of this function
true
}