Moving the data directory for systemd service startup

Поиск
Список
Период
Сортировка
От Evan Rempel
Тема Moving the data directory for systemd service startup
Дата
Msg-id 56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca
обсуждение исходный текст
Ответы Re: Moving the data directory for systemd service startup
RE: Moving the data directory for systemd service startup
Список pgsql-admin
I am using the official RPMs for RHEL-7 and am having difficulty in using a different database directory than the
default of

/var/lib/pgsql/9.6/data/
or
/var/lib/pgsql/10/data/


It is easy to modify the service file

/usr/lib/systemd/system/postgresql-9.6.service

with the line

Environment=PGDATA=/var/lib/pgsql/9.6/data/

to point to the location I want, but an RPM update will replace this file and break database startup.

I was hoping that there would be a line

EnvironmentFile=-/etc/sysconfig/pgsql/postgresql-9.6

or

EnvironmentFile=-/etc/sysconfig/pgsql/postgresql-10

to allow for customization of the environment variables, similar to the init.d startup, but I don't see one.


Am I missing something, or is the configuration of the systemd unit file an oversight?

Any information would be helpful.

Evan.



В списке pgsql-admin по дате отправления:

Предыдущее
От: Sohel Tamboli
Дата:
Сообщение: Upgrade postgresql from 9.1 to 9.6
Следующее
От: Ron
Дата:
Сообщение: Re: Upgrade postgresql from 9.1 to 9.6