Do not install a default database when installing the -server subpackage,

instead give advice on how to install a dabase with proper protection.

ok pvalchev, bernd, krw
This commit is contained in:
mbalmer 2006-10-18 13:54:22 +00:00
parent 76277785aa
commit 8db0aad7ce
4 changed files with 25 additions and 37 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.91 2006/10/15 16:00:11 mbalmer Exp $
# $OpenBSD: Makefile,v 1.92 2006/10/18 13:54:22 mbalmer Exp $
COMMENT= "PostgreSQL RDBMS (client)"
COMMENT-server= "PostgreSQL RDBMS (server)"
@ -7,7 +7,7 @@ COMMENT-docs= "PostgreSQL RDBMS documentation"
VERSION= 8.1.5
DISTNAME= postgresql-${VERSION}
FULLPKGNAME= postgresql-client-${VERSION}
PKGNAME-server= postgresql-server-${VERSION}
PKGNAME-server= postgresql-server-${VERSION}p0
PKGNAME-docs= postgresql-docs-${VERSION}
CATEGORIES= databases

View File

@ -1,56 +1,40 @@
Requirements
------------
Please note that the OpenBSD port of the PostgreSQL server requires a
kernel compiled with SYSVSEM and SYSVSHM options for proper operation.
The GENERIC kernel has these settings.
Using PostgreSQL in an OpenBSD environment
------------------------------------------
If you are installing PostgreSQL for the first time, a default database
will have been created for you. If this failed for any reason or if you
want to use non-default paramaters, you can do something similar to the
following steps manually:
If you are installing PostgreSQL for the first time, you have to create
a default database first. In the following example we install a database
in /var/postgresql/data with a dba account 'postgres' and md5 authentication.
We will be prompted for a password to protect the dba account:
# su - _postgresql
$ mkdir /var/postgresql/data
$ initdb -D /var/postgresql/data
$ initdb -D /var/postgresql/data -U postgres -A md5 -W
If you are upgrading PostgreSQL then you may have a `pgsql' or `postgresql'
user. It is suggested that you follow the steps in
!!PREFIX!!/share/doc/postgresql/INSTALL
for more information on how to upgrade your existing databases. See
also `Special notes for the OpenBSD port' below. Replace references to
the `postgresql' user below with `pgsql' or whatever other user you
have selected to be the database administration account.
Please consult the PostgreSQL website for more information, especially when
you are upgrading an existing database installation.
Auto Start and Stop
-------------------
If you wish to start PostgreSQL automatically during system startup,
add the following lines to /etc/rc.local:
To start PostgreSQL at boot and shut it down when the system shuts down,
add the following lines to /etc/rc.local and /etc/rc.shutdown, respectively:
/etc/rc.local:
if [ -x !!PREFIX!!/bin/pg_ctl ]; then
su -l _postgresql -c "nohup !!PREFIX!!/bin/pg_ctl start \
-D /var/postgresql/data -l /var/postgresql/logfile \
-o '-D /var/postgresql/data'"
-D /var/postgresql/data -l /var/postgresql/logfile \
-o '-D /var/postgresql/data'"
echo -n ' postgresql'
fi
To automatically shutdown the database as part of the system shutdown,
add the following lines to /etc/rc.shutdown:
/etc/rc.shutdown:
if [ -f /var/postgresql/data/postmaster.pid ]; then
su -l _postgresql -c "!!PREFIX!!/bin/pg_ctl stop -m fast \
-D /var/postgresql/data"
-D /var/postgresql/data"
rm -f /var/postgresql/data/postmaster.pid
fi
Network Connections and Tuning
------------------------------
To allow connections over TCP (and other options) edit the file:

View File

@ -1,2 +1,7 @@
For more information on using PostgreSQL in an OpenBSD environment,
please see ${PREFIX}/share/doc/postgresql/README.OpenBSD.
* Important note for users familar with former versions of this package:
The postgresql-server package does no longer install a default database.
To use the postgresql server you have to create a database first.
You find detailled instructions on how to install a database in the file
${PREFIX}/share/doc/postgresql/README.OpenBSD.

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-server,v 1.10 2006/10/09 11:55:18 aanriot Exp $
@comment $OpenBSD: PLIST-server,v 1.11 2006/10/18 13:54:22 mbalmer Exp $
@conflict pgsql-*
@conflict pgsql-clients-*
@conflict postgresql-clients-*
@ -403,4 +403,3 @@ share/postgresql/postgresql.conf.sample
@owner _postgresql
@group _postgresql
@sample /var/postgresql/
@exec su _postgresql -c "%D/bin/initdb -D /var/postgresql/data"