name: postgresql user: postgres command: postgres -D ${SERVICE_ROOT} -k /tmp/postgresql-${ENVIRONMENT} #stop-command: kill -HUP ${PID} environment-variables: - PGROOT=${SERVICE_ROOT} provides: postgresql %check name: database directory creation directory: ${SERVICE_ROOT} command: mkdir -p ${SERVICE_ROOT} && chown postgres:postgres ${SERVICE_ROOT} %check name: database creation file: ${SERVICE_ROOT}/base command: su - postgres -c "initdb --locale en_US.UTF-8 -D '${SERVICE_ROOT}'" && rm ${SERVICE_ROOT}/postgresql.conf %check name: database configuration # once this file is created, there is no need to perform the command file: ${SERVICE_ROOT}/postgresql.conf # gen-config inherits its parameters from the environment command: gen-config postgresql.conf ${SERVICE_ROOT}/postgresql.conf && chown postgres:postgres ${SERVICE_ROOT}/postgresql.conf %check name: sockets directory directory: /tmp/postgresql-${ENVIRONMENT} # FIXME: impose permissions command: mkdir -p /tmp/postgresql-${ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-${ENVIRONMENT} # FIXME: add postgresql-check-db-dir around here