Skip to content

Add post-start hook to remove stale PostgreSQL sockets#620

Open
PiRomant wants to merge 1 commit intogreenbone:mainfrom
PiRomant:patch-1
Open

Add post-start hook to remove stale PostgreSQL sockets#620
PiRomant wants to merge 1 commit intogreenbone:mainfrom
PiRomant:patch-1

Conversation

@PiRomant
Copy link

What

Added post_start exec action to the postgres service that safely removes common socket/lock files before PostgreSQL binds.

No data loss risk - only removes ephemeral socket/lock files.
Container now starts reliably even after abrupt SIGKILL

Tested: Verified volume cleanup works after forced inserted socket and lock files in greenbone-community-edition_psql_socket_vol before container started.

Why

PostgreSQL often fails to start due to stale socket files (like .s.PGSQL.5432) or lock files left from improper shutdowns, causing errors about existing sockets or locks.
Abstract sockets (@/tmp) avoid this entirely but can’t share across containers.

Checklist

@PiRomant PiRomant requested a review from a team as a code owner March 19, 2026 07:42
@greenbonebot greenbonebot enabled auto-merge (rebase) March 19, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant