[luau] Postgres Question on RH9

Warren Togami warren at togami.com
Tue Jul 1 22:03:00 PDT 2003


Don't fret, your problem is fairly simple.  The directions you were
following, like far too many other documentation for open source software,
assume that you installed postresql from sources.  That is why they told you
to put stuff in rc.local for it to startup automatically at bootup.  They
may have also told you to make many other configurations that don't are
probably not necessary, or perhaps even will break it when using Red Hat
packages.

All Red Hat packages are packaged in a standard way where you never have to
edit scripts like rc.*, and most configuration options are already done for
you upon installation.  Given any usual service on Red Hat Linux (or similar
distributions like Mandrake), you can use the chkconfig and service tools to
manually manage start, stop, restart, and automatically starting the service
at bootup.

chkconfig --list
    This lists all services installed on your computer, and whether they are
"on" or "off" at a certain runlevel.  Runlevel 3 is multi-user with network,
while Runlevel 5 is multi-user with network and X.  You are probably one of
those two runlevels by default.  You can change the current runlevel with
"init 3" or "init 5", but be warned that init 3 will kill your current X
session.

chkconfig knows about the services from the scripts installed in
/etc/rc.d/init.d/  You can actually go into that directory and read the
simple scripts within there, and see how they control start, stop, restart
and so on.

/etc/rc.d/init.d/postgresql
In the case of PostgreSQL, Red Hat's postgresql-server package installed
this script.  This means that you can use the following commands.

service postgresql start
    Manually start postgresql.
service postgresql stop
    Manuallly stop postgresql
service postgresql restart
    Stop and start postgresql
service postgresql
    Lists other possible commands, like "status" and "reload".

Generally every service has those basic service commands, and you can
control whether they automatically start during bootup with:

chkconfig postgresql on

If you subsequently use chkconfig --list, you will see that postgresql is
now set to "on" for runlevel 3 and 5.  This means it will start when the
system changes to those runlevels, either during bootup, or manually with
the "init" command.

At this point I suggest undoing all configurations you may have done to your
system (rc.local, maybe more), uninstall all postgresql and related
packages, and reinstall with the packages so you are guaranteed to have
fresh config files.  To be absolutely sure your modified config files are
gone, make sure they are erased manually before reinstalling the package.

For long term easy installation and maintenance of your Red Hat packages,
please consider using an automatic package tool like up2date, or apt-get
from Fedora Linux.

http://www.fedora.us
Go here and follow the "Fedora HOWTO".

With apt-get, reinstalling this would be as easy as:
apt-get remove postgresql postgresql-server php-postgresql
apt-get update
apt-get install postgresql-server postgresql php-postgresql

service httpd restart
   Apache should be restarted after installing php extensions like
PostgreSQL so it knows about the change.

Also use "apt-get dist-upgrade" and it will upgrade all of your packages to
the latest version.  Tools like apt-get make system updating so easy, that
it is no longer a chore.

Also know that you should almost never need to reboot your Linux computer
except in certain kernel related circumstances.  Once you master service
control and package management, you can easily go for months without
rebooting but still maintain the latest security updates.  This is quite
different from our nearest competitor where "scheduled reboots" are common
in order to maintain long term stability, and absolutely necessary after
many security patches.

Warren Togami
warren at togami.com




More information about the LUAU mailing list