013: make config dir/ini readable so non-root status works

/etc/pgbouncer was 750 postgres:postgres, so "sysmig status" as the
login user false-DRIFTed on the -f check. Dir 755 + ini 644; userlist
(future SCRAM verifiers) stays 640 postgres.
This commit is contained in:
wan
2026-08-31 22:26:17 +09:00
parent ff3f6732e9
commit c639b5397f
+4 -2
View File
@@ -27,7 +27,9 @@ USERLIST=/etc/pgbouncer/userlist.txt
LOG=/var/log/postgresql/pgbouncer.log LOG=/var/log/postgresql/pgbouncer.log
write_ini() { write_ini() {
install -d -o postgres -g postgres -m 750 /etc/pgbouncer # dir 755 + ini 644 so non-root `sysmig status` can verify; the only
# sensitive file is userlist.txt (SCRAM verifiers) - stays 640 postgres
install -d -m 755 /etc/pgbouncer
cat > "$INI" <<'EOF' cat > "$INI" <<'EOF'
;; managed by sysmig 013-install-pgbouncer - serverless connection pooler ;; managed by sysmig 013-install-pgbouncer - serverless connection pooler
[databases] [databases]
@@ -65,7 +67,7 @@ pidfile = /var/run/postgresql/pgbouncer.pid
user = postgres user = postgres
EOF EOF
chown postgres:postgres "$INI" chown postgres:postgres "$INI"
chmod 640 "$INI" chmod 644 "$INI"
} }
case "${1:-}" in case "${1:-}" in