Re: Re: Struggling to change default data location

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: Re: Struggling to change default data location
Дата
Msg-id 200104262034.f3QKYjU30265@linda.lfix.co.uk
обсуждение исходный текст
Ответ на Re: Struggling to change default data location  ("Geoff Caplan" <geoff@productivity.co.uk>)
Список pgsql-general
"Geoff Caplan" wrote:
  >Peter, thanks for your patience with a newbie. I think my stuckness stems
  >from 2 issues:
  >
  >1) Starting environment
  >
  >> The environment initdb runs in when it runs at system startup is probably
  >> not the one you set up.  Check the /etc/init.d/postgresql file for
  >> details.
  >
  >This is certainly true, as my settings are overridden. I have had a look at
  >this file, but I am still not clear what environment it is reading when it
  >sets $PGDATA.  Can you clarify where this environment
  >config file should be (on RedHat)?

I can't speak for RedHat, but this is a general description of what happens
at boot time, which may help you to work out what is happening:

after the kernel starts running it starts a program called init, which is
responsible for setting up the multi-user environment and all services,
either directly or indeirectly.  At one point in the process, the system
changes into multi-user mode and runs the scripts for the default run-level.
These scripts are usually linked to files in /etc/init.d/.

All this is done with the permissions and identity of the Unix superuser,
so it is necessary for the postgresql startup script to arrange to become
the postgresql superuser to start the postmaster (which root is not
allowed to do).  The command to change identity is su, and it makes a
difference whether the script uses `su postgres' or `su - postgres'; the
latter should set up the postgres login environment, but the former will not.

  >2) Passing parameters to postmaster during starup
  >
  >Also, the init.d script uses pg_ctl to start the postmaster. I need to pass
  >the -i parameter using the "postmaster" utility. (As I understand it, in
  >past releases of these
  >RPMs -i was set as a default). At what point in the startup sequence can you
  >pass "postmaster" utility params to the postmaster process?

Another way to do this is to set options in postgresql.conf; have a line
in it that says:

TCPIP_SOCKET = yes

almost all options can be set there.  See Administrator's Guide (7.1 version)
section 3.4


--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Submit yourselves therefore to God. Resist the devil,
      and he will flee from you."          James 4:7



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

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: Re: Re: Need for newbie friendly docs (was Newbie struggling...)
Следующее
От: "Thomas F. O'Connell"
Дата:
Сообщение: creating constants in postgres