| 1 |
# The postgres server's /var, declared so it survives an upgrade. |
| 2 |
# |
| 3 |
# Only shipped when DB=postgres16. `postgresql16-server`'s %post creates |
| 4 |
# /var/lib/pgsql and two directories under it on the build host, which makes |
| 5 |
# them image content in /var: `bootc install` copies that into the stateroot, so |
| 6 |
# a fresh install has them, and an upgrade re-syncs /usr and leaves /var alone, |
| 7 |
# so a machine already running never grows them. `bootc container lint` fails |
| 8 |
# the build on undeclared /var content (`var-tmpfiles`) for exactly that reason, |
| 9 |
# and it is what caught this: no fw13 image had ever built. |
| 10 |
# |
| 11 |
# Deleted on DB=none rather than shipped and inert, the same way |
| 12 |
# 50-alloy-var-client.conf is deleted on `server`: every line here names the |
| 13 |
# `postgres` user, which arrives with the packages that DB=none does not |
| 14 |
# install, and systemd-tmpfiles fails a line whose user does not resolve. |
| 15 |
# |
| 16 |
# Modes and owners are read off the built image rather than chosen: 0700 |
| 17 |
# postgres postgres on all three, which is what the RPM's %post sets and what |
| 18 |
# initdb refuses to run without. |
| 19 |
# |
| 20 |
# THE .bash_profile IS NOT A tmpfiles LINE BY ACCIDENT. The RPM also ships |
| 21 |
# /var/lib/pgsql/.bash_profile, a regular file, and tmpfiles.d has no type that |
| 22 |
# describes an existing file's contents — bootc reports those separately as |
| 23 |
# "non-directory/non-symlink files in /var" and there is nothing to declare that |
| 24 |
# fixes it. So the Containerfile moves it under /usr, where image content |
| 25 |
# belongs, and `C` copies it back on first boot. `C` copies only when the |
| 26 |
# destination is absent, so a machine whose postgres user edited the file keeps |
| 27 |
# the edit. |
| 28 |
# |
| 29 |
# It matters rather than being tidiness: the file exports PGDATA, and `su - |
| 30 |
# postgres` on a build host is how a scratch cluster gets restored into. Dropping |
| 31 |
# it would leave initdb and pg_ctl with no data directory and no error that names |
| 32 |
# the cause. |
| 33 |
# |
| 34 |
#Type Path Mode User Group Age Argument |
| 35 |
d /var/lib/pgsql 0700 postgres postgres - - |
| 36 |
d /var/lib/pgsql/backups 0700 postgres postgres - - |
| 37 |
d /var/lib/pgsql/data 0700 postgres postgres - - |
| 38 |
C /var/lib/pgsql/.bash_profile 0644 postgres postgres - /usr/share/alloy/pgsql/bash_profile |
| 39 |
|