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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user