fix(bootstrap): make postgresql a soft dep so the one-shot runs with a remote DB#52
Merged
Merged
Conversation
duynhlab-bootstrap.service had Requires=postgresql.service. With a remote, managed, or containerized database there is no local postgresql.service unit, so the start job failed with result 'dependency' — the one-shot never ran, no roles/DBs were created, and the backends started and crashed with role "duynhlab_<svc>_app" does not exist. Make PostgreSQL a soft Wants=/After= dep: a same-host postgresql.service is still pulled and ordered first, but its absence no longer blocks the one-shot. The helper already waits for the DB to accept connections (pg_isready) on its own. Caught by the hardened integration test (sidecar DB has no local pg unit).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hardened integration test (#51) caught a real bug in the auto-bootstrap one-shot (#49).
duynhlab-bootstrap.servicedeclaredRequires=postgresql.service. When PostgreSQL is not a local systemd unit (remote/managed DB, or the sidecar in the integration test), that unit can't be satisfied, so the start job fails withresult 'dependency'— the one-shot never executes. No roles/DBs get created, and the backends then start and crash withrole "duynhlab_<svc>_app" does not exist.Fix: PostgreSQL becomes a soft
Wants=/After=dependency. A same-hostpostgresql.serviceis still pulled in and ordered before bootstrap; a remote/containerized DB simply has no local unit and no longer blocks the job. The helper already waits for the DB to accept connections viapg_isready, so readiness is handled regardless of how PostgreSQL is hosted.Verified post-merge on the
mainpush run (integration only runs there).