[GENERAL] Start/stop postgresql with pg_ctl or service without root access on RHEL

Поиск
Список
Период
Сортировка
От Jean-Michel Scheiwiler
Тема [GENERAL] Start/stop postgresql with pg_ctl or service without root access on RHEL
Дата
Msg-id CAGbCck9wS=GL0mZhYxMntUgvXgyyXS1gqVbzoh9pwD+LLNYnSg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Start/stop postgresql with pg_ctl or service without root access on RHEL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello

We plan to use postgresql on RHEL 6.

DBAs won't have root access but they will need to start/stop the databases. They'll be able to do so with pg_ctl as postgres.

However databases should also start automatically when the server reboots and so we should use services (/etc/init.d/postgresql-9.x).

When postgres is started with service (as root) and stopped with pg_ctl as postgres, the pid file in $PGDATA is deleted but not the specific pid and lock files (respectively in /var/run and /var/lock/subsys) created by the init.d script.

It leads to an inconsistent state where service postgresql-9.x status throws"postgresql-9.x dead but pid file exists".

So what is the best practice and solution for this situation?

  • ask sysadmin to give sudo /etc/init.d/postgresql-9.x to the DBAs and never use pg_ctl again?

  • remove the specific pid and lock files from the postgresql-9.x service script?

  • any other idea?
Thank you in advance

JM Scheiwiler

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

Предыдущее
От: Tom DalPozzo
Дата:
Сообщение: [GENERAL] update error with serializable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Start/stop postgresql with pg_ctl or service without root access on RHEL