The PostgreSQL component, out of the shared tree and into a unit #1

Merged
marcos-mendez merged 1 commit from feat/the-postgresql-component into main 2026-09-27 16:59:01 -03:00
marcos-mendez commented 2026-09-27 15:07:50 -03:00 (Migrated from github.com)

The second component to move under decision 0010.

shared tree here
overlays/pgsql overlay/, byte identical, modes included
conf/pgsql conf, executable
mk/turnkey/pgsql.mk conf-vars, naming PGSQL_PASS
the package names, which lived in each recipe plan
removelists/pgsql nothing, there was none

Two changes to the conf script, both deliberate:

  1. The bind addresses move into the component. listen_addresses = '::1,127.0.0.1', two literal addresses, which keel-postgresql's conf.d/main set until today. Binding is what whoever installs the server decides, and LAPP will carry this component without carrying that recipe: decision 0013 makes the database a component so LAMP and LAPP can share one apache-php layer, and a fix living in one recipe would have to be copied into the other. Debian's 'localhost' binds the IPv4 loopback only, because /etc/hosts maps ::1 to ip6-localhost and never to localhost.
  2. PG_LIB_DIR and PG_CONF_ROOT are overridable defaults, so the script can be measured. A build sets neither, and the script ships nowhere, because fab copies it into the chroot, runs it and removes it.

PGSQL_PASS is carried in conf-vars, unlike MYSQL_PASS in unit-mariadb, because this conf script actually reads it.

Test plan:

  • bats tests/, 23 tests
  • COVERAGE_THRESHOLD=100 tests/coverage.sh, 100 percent (17/17), gate raised from the bootstrap 0
  • the three-build comparison of decision 0010 for the postgresql layer, plus a fourth build to attribute the changelog entry
The second component to move under decision 0010. | shared tree | here | | --- | --- | | `overlays/pgsql` | `overlay/`, byte identical, modes included | | `conf/pgsql` | `conf`, executable | | `mk/turnkey/pgsql.mk` | `conf-vars`, naming `PGSQL_PASS` | | the package names, which lived in each recipe | `plan` | | `removelists/pgsql` | nothing, there was none | Two changes to the conf script, both deliberate: 1. **The bind addresses move into the component.** `listen_addresses = '::1,127.0.0.1'`, two literal addresses, which `keel-postgresql`'s `conf.d/main` set until today. Binding is what whoever installs the server decides, and LAPP will carry this component without carrying that recipe: decision 0013 makes the database a component so LAMP and LAPP can share one `apache-php` layer, and a fix living in one recipe would have to be copied into the other. Debian's `'localhost'` binds the IPv4 loopback only, because `/etc/hosts` maps `::1` to `ip6-localhost` and never to `localhost`. 2. **`PG_LIB_DIR` and `PG_CONF_ROOT` are overridable defaults**, so the script can be measured. A build sets neither, and the script ships nowhere, because fab copies it into the chroot, runs it and removes it. `PGSQL_PASS` is carried in `conf-vars`, unlike `MYSQL_PASS` in `unit-mariadb`, because this conf script actually reads it. Test plan: - [x] `bats tests/`, 23 tests - [x] `COVERAGE_THRESHOLD=100 tests/coverage.sh`, 100 percent (17/17), gate raised from the bootstrap 0 - [ ] the three-build comparison of decision 0010 for the `postgresql` layer, plus a fourth build to attribute the changelog entry
marcos-mendez commented 2026-09-27 16:57:57 -03:00 (Migrated from github.com)

Measured: four builds of bt-layer postgresql --parent core on the build host, with the recipe change in keel-postgresql#7. Package list identical (430), symlinks identical (3,802), 14 of 37,439 files differing against a 13-file noise floor, and exactly one path outside it: /etc/postgresql/17/main/postgresql.conf, differing in the trailing comment of the listen_addresses line. The value is byte identical, so the bind fix survives the move.

Measured: four builds of `bt-layer postgresql --parent core` on the build host, with the recipe change in keel-postgresql#7. Package list identical (430), symlinks identical (3,802), 14 of 37,439 files differing against a 13-file noise floor, and exactly one path outside it: `/etc/postgresql/17/main/postgresql.conf`, differing in the trailing comment of the `listen_addresses` line. The value is byte identical, so the bind fix survives the move.
Sign in to join this conversation.
No description provided.