Re: freebsd sample startup script doesn't work

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: freebsd sample startup script doesn't work
Дата
Msg-id 200105031702.f43H2wA04152@candle.pha.pa.us
обсуждение исходный текст
Ответ на freebsd sample startup script doesn't work  (Vivek Khera <khera@kcilink.com>)
Ответы Re: freebsd sample startup script doesn't work  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-bugs
OK, I think this is already fixed in 7.1.1.  The fix was to add -D to
pg_ctl.  Would you try 7.1.1 or the snapshot and let me know.  Thanks.

New line shows:

        su -l $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG"

You will need an updated pg_ctl that understands -D.

>
> Got it.  I recommend changing 'su -l' to 'su -m' to preserve the
> environment.  How does that sound?
>
>
> > I installed the sample startup script for postgres for FreeBSD, but it
> > reports the following error upon running:
> >
> > # /usr/local/etc/rc.d/postgres.sh start
> > pg_ctl: no database directory or environment variable $PGDATA is specified
> > Try 'pg_ctl --help' for more information.
> >
> > I see clearly that PGDATA is set and exported.  I'm suspecting that
> > the "su -l" causes the environment to disappear.  My guess is that
> > whomever wrote this script has PGDATA set in the ~/.profile (or
> > equivalent) in the postgres user's home directory.
> >
> > Thus, it is pointless to set PGDATA in the script.  Setting and
> > exporting PGDATA in the ~/.profile file lets postgres start as
> > expected.
> >
> > The commentary says to copy the file to /usr/local/etc/rc.d/postgresql
> > but this is not useful; the file must in '.sh' and be executable or
> > FreeBSD will ignore it on boot.
> >
> > Also, the following line in the start action of the sript is useful:
> >
> >         /sbin/ldconfig -m $prefix/lib
> >
> >
> > --
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Vivek Khera, Ph.D.                Khera Communications, Inc.
> > Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
> > AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://www.postgresql.org/search.mpl
> >
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: freebsd sample startup script doesn't work
Следующее
От: Piers Scannell
Дата:
Сообщение: RE: Found an example prooving bug