@@ -28,18 +28,18 @@ die() {
2828 log " ERROR: $1 " >&2
2929
3030 # Stop PostgreSQL service if it was started
31- if systemctl is-active --quiet " ${SERVICE_NAME} " 2> /dev/null; then
32- log " Stopping PostgreSQL service..."
33- sudo systemctl stop " ${SERVICE_NAME} " 2> /dev/null || true
34- fi
31+ # if systemctl is-active --quiet "${SERVICE_NAME}" 2>/dev/null; then
32+ # log "Stopping PostgreSQL service..."
33+ # sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
34+ # fi
3535
3636 # Remove systemd service
37- if [ -f " /etc/systemd/system/${SERVICE_NAME} .service" ]; then
38- log " Removing systemd service..."
39- sudo systemctl disable " ${SERVICE_NAME} " 2> /dev/null || true
40- sudo rm -f " /etc/systemd/system/${SERVICE_NAME} .service"
41- sudo systemctl daemon-reload
42- fi
37+ # if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then
38+ # log "Removing systemd service..."
39+ # sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
40+ # sudo rm -f "/etc/systemd/system/${SERVICE_NAME}.service"
41+ # sudo systemctl daemon-reload
42+ # fi
4343
4444 # Destroy ZFS dataset if it was created
4545 # if sudo zfs list "${ZFS_DATASET}" >/dev/null 2>&1; then
@@ -159,11 +159,11 @@ PG_MAX_PREPARED_XACTS=$(sudo -u postgres grep -h "^max_prepared_transactions" "$
159159PG_MAX_LOCKS_PER_XACT=$( sudo -u postgres grep -h " ^max_locks_per_transaction" " ${DATA_DIR} /postgresql.conf" 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 64" )
160160
161161# Extract from conf.d files
162- CONFD_MAX_CONNECTIONS=$( sudo -u postgres grep -h " ^ max_connections" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
163- CONFD_MAX_WORKER_PROCESSES=$( sudo -u postgres grep -h " ^ max_worker_processes" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
164- CONFD_MAX_WAL_SENDERS=$( sudo -u postgres grep -h " ^ max_wal_senders" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
165- CONFD_MAX_PREPARED_XACTS=$( sudo -u postgres grep -h " ^ max_prepared_transactions" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
166- CONFD_MAX_LOCKS_PER_XACT=$( sudo -u postgres grep -h " ^ max_locks_per_transaction" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
162+ CONFD_MAX_CONNECTIONS=$( sudo -u postgres grep -h " max_connections" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | grep -v " ^\s*# " | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
163+ CONFD_MAX_WORKER_PROCESSES=$( sudo -u postgres grep -h " max_worker_processes" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | grep -v " ^\s*# " | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
164+ CONFD_MAX_WAL_SENDERS=$( sudo -u postgres grep -h " max_wal_senders" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | grep -v " ^\s*# " | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
165+ CONFD_MAX_PREPARED_XACTS=$( sudo -u postgres grep -h " max_prepared_transactions" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | grep -v " ^\s*# " | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
166+ CONFD_MAX_LOCKS_PER_XACT=$( sudo -u postgres grep -h " max_locks_per_transaction" " ${DATA_DIR} /conf.d/" * .conf 2> /dev/null | grep -v " ^\s*# " | tail -1 | sed " s/.*=\s*['\" ]*//" | sed " s/['\" ].*//" || echo " 0" )
167167
168168# Use MAX of both to ensure recovery requirements are met
169169MAX_CONNECTIONS=$( max_value " $PG_MAX_CONNECTIONS " " $CONFD_MAX_CONNECTIONS " )
0 commit comments