Configuring PostgreSQL
Config files
$PGDATA/pg_ident.con, $PGDATA/pg_hba.conf, $PGDATA/postgresql.conf
The PGDATA environment variable is used to distinguish database
clusters from one another by setting it to the value of the directory
which contains the cluster desired. The three configuration files
exist in every PGDATA/ directory.
Details on the format of the files and the options that can be set in
each can be found in .
Create the boot script with the following:
cat > /etc/rc.d/init.d/postgresql << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/postgresql
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
. /etc/sysconfig/rc
. $rc_functions
case "$1" in
start)
echo "Starting PostgreSQL daemon..."
su - postgres -c '/usr/bin/pg_ctl start -W -D /var/pgsql/data \
-l /var/pgsql/data/logfile -o "-i" '
evaluate_retval
;;
stop)
echo "Stopping PostgreSQL daemon..."
/usr/bin/pg_ctl stop -m smart -D /var/pgsql/data
evaluate_retval
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
/usr/bin/pg_ctl status -D /var/pgsql/data
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
# End $rc_base/init.d/
EOF
chmod 755 /etc/rc.d/init.d/postgresql
Create the symbolic links to this file in the relevant
rc.d directory
with the following commands:
cd /etc/rc.d/init.d &&
ln -sf ../init.d/postgresql ../rc0.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc1.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc2.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc3.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc4.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc5.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc6.d/K26postgresql