From edf8e51856aa8475fa5f10623efbddf53d5c2401 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 3 Apr 2018 19:39:11 +0300 Subject: [PATCH] Prevent ds crash by wrong pg rights --- run-document-server.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index d95673e..f28999a 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -45,9 +45,10 @@ JSON_EXAMPLE="json -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}" LOCAL_SERVICES=() +PG_ROOT=/var/lib/postgresql PG_VERSION=9.5 PG_NAME=main -PGDATA=/var/lib/postgresql/${PG_VERSION}/${PG_NAME} +PGDATA=${PG_ROOT}/${PG_VERSION}/${PG_NAME} PG_NEW_CLUSTER=false read_setting(){ @@ -282,6 +283,11 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then waiting_for_postgresql create_postgresql_tbl else + # change rights for postgres directory + chown -R postgres:postgres ${PG_ROOT} + chmod -R 700 ${PG_ROOT} + + # create new db if it isn't exist if [ ! -d ${PGDATA} ]; then create_postgresql_cluster PG_NEW_CLUSTER=true