#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    3
    Rep Power
    0

    automatic postrgresql startup?


    is it possible to automatically start the postgresql postmaster when i boot up?
  2. #2
  3. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,322
    Rep Power
    33
    All you need to do is place the postmaster startup command in whatever file is used for the boot up of the system.

    I can't tell you anymore than that since you havent specified what system you are on, help us help you.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    3
    Rep Power
    0
    sorry, I use linux (slackware 9.0 distribution). I run postgresql version 7.3.2.
  6. #4
  7. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    For Slackware, here is the quick easy answer: just put a line something like this in /etc/rc.d/rc.local
    Code:
    su postgres -c "/usr/local/pgsql/bin/pg_ctl start -o -i -D /usr/local/pgsql/data -s -l /usr/local/pgsql/data/serverlog"
    This is assuming the following:

    1. the main user for the postgres daemon is 'postgres'. If yours is different, put that user in the 'su [username] -c position.

    2. /etc/rc.d/rc.local is already there and already has the shell script header (#!/usr/bin/bash). If not, and you are creating the file for the first time, make sure that #!/usr/bin/bash is at the top of your file, and that the file is chmodded executable.

    3. Of course correct for path if your binaries or log are different from the above

    See PostgreSQL documentation, or the INSTALL file for more information about the pg_ctl startup options)
    The real n-tier system:

    FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

    Amazon wishlist -- rycamor (at) gmail.com

IMN logo majestic logo threadwatch logo seochat tools logo