Re: initlocation and createdb

Поиск
Список
Период
Сортировка
От Jeff Hoffmann
Тема Re: initlocation and createdb
Дата
Msg-id 394701FB.DA0C396B@propertykey.com
обсуждение исходный текст
Ответ на RE: initlocation and createdb  ("Barnes" <aardvark@ibm.net>)
Список pgsql-general
Barnes wrote:
>
> Thank you.  This works, and is close to what I need, but if I don't launch
> the postmaster from a window with PGDATA2 defined, such as is done with
> "/etc/init.d/postgresql start" or on a system boot, then it doesn't work.  I
> tried to export PGDATA2 within /etc/init.d/postgresql, but that didn't work
> for me.
>
> Can I make this work from within /etc/init.d/postgresql, or do have to start
> the postmaster from a shell with the PGDATA2 already defined?
>
> Thanks again.

i'm not 100% sure that this works in all environments, but if your
startup script does a "su -l <username> -c ...", that's likely your
problem.  on the systems that i'm familiar with, the -l flag on su will
reset the environment & read the shell startup files (e.g., .profile).
so if you set the variable earlier in the script, it will be cleared out
before the program is actually run.   the .profile should be read when
the su is invoked & then variable should be available to you then.

hope this helps,

jeff

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

Предыдущее
От: Luis Martins
Дата:
Сообщение: Large objects
Следующее
От: "T.J.Farrell"
Дата:
Сообщение: PostgreSQL and multiple database access