service/services/postgresql.spec

31 lines
1.2 KiB
RPMSpec
Raw Normal View History

2019-08-10 17:16:24 +02:00
name: postgresql
user: postgres
command: postgres -D ${SERVICE_ROOT}/db -k /tmp/postgresql-${ENVIRONMENT}
2019-08-10 17:16:24 +02:00
#stop-command: kill -HUP ${PID}
readiness-check-command: pg_isready -p ${PORT_POSTGRESQL} -h localhost -q
2019-08-10 17:16:24 +02:00
environment-variables:
- PGROOT=${SERVICE_ROOT}
2019-10-24 15:54:15 +02:00
provides: postgresql
2019-10-29 12:32:49 +01:00
ports: postgresql
2019-08-10 17:16:24 +02:00
#%file db
# name: database directory
# command: mkdir -p db && chown postgres:postgres db
2019-08-10 17:16:24 +02:00
%file db
2019-11-09 14:53:30 +01:00
name: database
creation-command: mkdir db && chown postgres:postgres db && su - postgres -c "initdb --locale en_US.UTF-8 -D '${SERVICE_ROOT}/db'" && rm db/postgresql.conf
#export-command: FIXME
2019-10-22 18:33:51 +02:00
%configuration db/postgresql.conf
2019-11-09 14:53:30 +01:00
name: database configuration
# gen-config inherits its parameters from the environment
creation-command: gen-config postgresql.conf ${SERVICE_ROOT}/postgresql.conf && chown postgres:postgres ${SERVICE_ROOT}/postgresql.conf
2019-08-10 17:16:24 +02:00
%file /tmp/${SERVICE_NAME}-${ENVIRONMENT}
name: sockets directory
unless-directory: /tmp/${SERVICE_NAME}-${ENVIRONMENT}
# FIXME: impose permissions
creation-command: mkdir -p /tmp/${SERVICE_NAME}-${ENVIRONMENT} && chown postgres:postgres /tmp/${SERVICE_NAME}-${ENVIRONMENT}
# FIXME: add postgresql-pre-start-db-dir around here