Successful installation of PostgreSQL

Поиск
Список
Период
Сортировка
От Albert REINER
Тема Successful installation of PostgreSQL
Дата
Msg-id 19990729233700.A6204@frithjof
обсуждение исходный текст
Список pgsql-ports
I just succeeded in installing PostgreSQL according to the
installation instructions. Therein I find:

>    28.     The Postgres team wants to keep Postgres
>      working on all of the supported platforms. We
>      therefore ask you to let us know if you did or did
>      not get Postgres to work on you system. Please
>      send a mail message to pgsql-ports@postgresql.org
>      (mailto:pgsql-ports@postgresql.org) telling us the
>      following:
>      o  The version of Postgres (v6.5.1, 6.5, beta
>        990318, etc.).

v6.5.1

>      o  Your operating system (i.e. RedHat v5.2 Linux
>        v2.0.36).

Linux (SuSE 5.3), Kernel 2.0.35

>      o  Your hardware (SPARC, i486, etc.).

PC, AMD-K6 (233 MHz)

>      o  Did you compile, install and run the regression
>        tests cleanly? If not, what source code did you

Yes, including bigtest (approx. 115 minutes).

>        change (i.e. patches you applied, changes you
>        made, etc.), what tests failed, etc. It is normal

failed: int2 and int4, due to different error message format.

I used configure with option "--with-mb=LATIN3", and the regression
tests complained about some missing files (latin3.sql or similar).

>        to get many warning when you compile. You do not
>        need to report these.

================================================================

Some comments on the INSTALL file:

>    7. If you are upgrading an existing system then kill
>      the postmaster. Type
>      $ ps -ax | grep postmaster

If it is installed, you can get the PID more easily and reliably via
pidof; on my system, using bash, it's simply

$ kill `/sbin/pidof postmaster`

or

$ kill $(/sbin/pidof postmaster)

>    14.     Install the program. Type
>      $ cd /usr/src/pgsql/src
>      $ gmake install >& make.install.log &
>      $ tail -f make.install.log
>       The last line displayed will be
>      gmake[1]: Leaving directory
>      `/usr/src/pgsql/src/man'

This did not happen for me. Anyway, there is a "cat ../register.txt"
at the end of the makefile, and /usr/src/pgsql/src/man is probably
already taken care of in step 12 ("Install the man and HTML
documentation").

>    17.     If it has not already been done, then prepare
>      account postgres for using Postgres. Any account
...
>           variables) by putting these additional lines
>           to your login environment before starting
>           postmaster:
>               LC_COLLATE=C
>               LC_CTYPE=C
>               LC_COLLATE=C
>               export LC_COLLATE LC_CTYPE LC_COLLATE

IMHO there's really no point setting LC_COLLATE twice.

>    21.     Run postmaster in the background from your
>      Postgres superuser account (typically account
>      postgres). Do not run postmaster from the root
>      account!
>      Usually, you will want to modify your computer so
>      that it will automatically start postmaster
>      whenever it boots. It is not required; the

The solution for Linux in the contrib-directory would not work for my
system (SuSE 5.3, but probably also the more current SuSEs); my simple
solution (from my installation of version 6.3.2) is as follows:

/etc/rc.d/init.d/functions -------------------------------------
#!/bin/sh
#
# postgres.init Start postgres back end system.
#
# Author:       Thomas Lockhart <lockhart@alumni.caltech.edu>
#               modified from other startup files in the RedHat Linux distribution
# ------- modified Albert Reiner, 19990425:
#
PGACCOUNT="postgres"    # the postgres account (you called it something else?)
POSTMASTER="postmaster"    # this probably won't change

PGLOGFILE="/home/postgres/log.postgres"

#PGOPTS="-i -B 256"    # -i to enable TCP/IP rather than Unix socket
#PGOPTS="-B 256"        # Do we really need 256 buffers? a.r.
PGOPTS=

# See how we were called.
case "$1" in
  start)
    if [ -f ${PGLOGFILE} ]
    then
        mv ${PGLOGFILE} ${PGLOGFILE}.old
    fi
    echo -n "Starting postgres: "
# force full login to get path names
    su --login --command="$POSTMASTER $PGOPTS >& $PGLOGFILE &" \
                   $PGACCOUNT > /dev/null &
    sleep 5
    pid=`/sbin/pidof ${POSTMASTER}`
    echo -n "${POSTMASTER} [$pid]"
    echo
    ;;
  stop)
    echo -n "Stopping postgres: "
    pid=`/sbin/pidof ${POSTMASTER}`
    if [ "$pid" != "" ] ; then
        echo -n "${POSTMASTER} [$pid]"
        kill -TERM $pid
        sleep 1
    fi
    echo
    ;;
  *)
    echo "Usage: $0 {start|stop}"
    exit 1
esac

exit 0
----------------------------------------------------------------

This does not rely on /etc/rc.d/init.d/functions (non-existent on SuSE
5.3) or some environment variables set by Red Hat. To use this script
one has to:

*) login as root

*) copy the script (possibly after editing to suit one's needs)
   to /sbin/init.d/postgres

*) # cd rc2.d

*) # ln -s ../postgres K10postgres

*) # ln -s ../postgres S85postgres

*) # cd /sbin/init.d/rc3.d

*) # ln -s ../postgres K10postgres

*) # ln -s ../postgres S85postgres

The numbers in the links' names (I used 85 for Starting and 10 for
Killing) can be chosen differently, but we don't want the postmaster
to run without a network enabled; hence the S..postgres-links should
have a rather high number (so that it is started late; less than the
number of zzreached), and the K..postgres-links should have a
relatively small number (so that postmaster is killed early during
shutdown).

>    26.     Clean up after yourself. Type
>      $ rm -rf /usr/src/pgsql_6_5
>      $ rm -rf /usr/local/pgsql_6_5

/usr/src (and/or /usr/local) may be owned by root, so one may have to
su first.

I hope that some of the above remarks are of interest to you.

Albert Reiner.

--

---------------------------------------------------------------------------
  Post an / Mail to / Skribu al: Albert Reiner <areiner@tph.tuwien.ac.at>
---------------------------------------------------------------------------

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PORTS] RedHat6.0 & Alpha
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Stable vs Current (Was: Re: [HACKERS] Re: [PORTS] RedHat6.0 & Alpha)