service/services/postgresql.spec

33 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-08-10 17:16:24 +02:00
name: postgresql
user: postgres
2019-10-26 14:00:11 +02:00
command: postgres -D ${SERVICE_ROOT} -k /tmp/postgresql-${ENVIRONMENT}
2019-08-10 17:16:24 +02:00
#stop-command: kill -HUP ${PID}
environment-variables:
2019-10-26 14:00:11 +02:00
- 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
%pre-start
2019-08-10 17:16:24 +02:00
name: database directory creation
unless-directory: ${SERVICE_ROOT}
2019-10-26 14:00:11 +02:00
command: mkdir -p ${SERVICE_ROOT} && chown postgres:postgres ${SERVICE_ROOT}
2019-08-10 17:16:24 +02:00
%pre-start
2019-08-10 17:16:24 +02:00
name: database creation
unless-file: ${SERVICE_ROOT}/base
2019-10-26 14:00:11 +02:00
command: su - postgres -c "initdb --locale en_US.UTF-8 -D '${SERVICE_ROOT}'" && rm ${SERVICE_ROOT}/postgresql.conf
2019-10-22 18:33:51 +02:00
%pre-start
2019-10-22 18:33:51 +02:00
name: database configuration
# once this file is created, there is no need to perform the command
unless-file: ${SERVICE_ROOT}/postgresql.conf
2019-10-22 18:33:51 +02:00
# gen-config inherits its parameters from the environment
2019-10-26 14:00:11 +02:00
command: gen-config postgresql.conf ${SERVICE_ROOT}/postgresql.conf && chown postgres:postgres ${SERVICE_ROOT}/postgresql.conf
2019-08-10 17:16:24 +02:00
%pre-start
2019-08-10 17:16:24 +02:00
name: sockets directory
unless-directory: /tmp/postgresql-${ENVIRONMENT}
2019-08-10 17:16:24 +02:00
# FIXME: impose permissions
command: mkdir -p /tmp/postgresql-${ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-${ENVIRONMENT}
# FIXME: add postgresql-pre-start-db-dir around here