Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    76

    Default Postgres says it starts ok, but doesn't!

    I was having some problems with getting postgres started. When I tried service postgresql start - it would come back that postgresql is an unrecognized service. At the advice of people on this forum, I reinstalled postgresql. When in whm, it states that posgresql started ok, but in service status it still says failed. I have uncommented the tcp and port lines from postgresql.conf and set the tcp = true. I can log in and create a db and user, but when I try to connect to db, I receive an error message Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown host name: localhost.

    Any ideas?

    I would really appreciate any help that anyone can offer.

    Thanks,
    Andy

  2. #2
    Member
    Join Date
    Mar 2004
    Location
    India
    Posts
    93

    Default

    Hello,

    If postgresql on Cpanel refuses to start even after reinstalling it from /scripts, try the following steps :

    1. Delete the postgre files in /tmp.
    2. rm -rf /var/lib/pgsql/data
    3. su - postgres
    4. initdb
    5. start postgre from ssh
    6. Go back and try the WHM functions again.

    After doing #4 the msg. ends with:

    Success. You can now start the database server using:

    /usr/bin/postmaster -D /var/lib/pgsql/data
    or
    /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

    Chose the first option or start Postgres from WHM.

    If any body else have any suggestion regarding please post the reply or suggest another solution .

    Thank You.
    Vivek

  3. #3
    Member
    Join Date
    Jan 2004
    Posts
    76

    Default

    Hello Vivek,
    thanks for your help.

    At step 4, I get this:
    initdb: You must identify where the the data for this database
    system will reside. Do this with either a -D invocation
    option or a PGDATA environment variable.

  4. #4
    Member
    Join Date
    Jan 2004
    Posts
    76

    Default

    Got that far, I received the Success message went to start postgres using the /usr/bin/postmaster -D /var/lib/pgsql/data command and it hangs at
    LOG: database system is ready - not sure if this is normal but it doesn't bring me back to a prompt yet.

  5. #5
    Member
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    378

    Default

    ive got the same problem...

    havent tried this yet tho!
    Sheldon King
    Server Adminisrator
    http://www.forgehosting.com

  6. #6
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    Quote Originally Posted by onaweb
    Got that far, I received the Success message went to start postgres using the /usr/bin/postmaster -D /var/lib/pgsql/data command and it hangs at
    LOG: database system is ready - not sure if this is normal but it doesn't bring me back to a prompt yet.
    hit ctrl-c and then change the postgres password in WHM. Then restart it in WHM.

  7. #7
    Member
    Join Date
    Jan 2004
    Posts
    76

    Default

    Now we just took 2 steps back. Now if I try to restart Postgres in WHM I get this:
    postgresql has failed, please contact the sysadmin (result was "postmaster is not running").

  8. #8
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    initdb -D /var/lib/pgsql/data

    and restarting it from whm should work.

  9. #9
    Member
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    378

    Default

    didnt work for me!
    Sheldon King
    Server Adminisrator
    http://www.forgehosting.com

  10. #10
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    Quote Originally Posted by Sheldon
    didnt work for me!
    Then try vivek's post again. That is how I have gotten it running on 3 different stubborn servers. Try both
    /usr/bin/postmaster -D /var/lib/pgsql/data
    and
    /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
    to get it started. Once it's running you should be able to change the password and set up the configuration file via WHM. Then you can restart it from WHM. Don't give up. Eventually it will work.

  11. #11
    Member
    Join Date
    Mar 2004
    Location
    India
    Posts
    93

    Default

    Hey casey,

    It works for me perfectly, its not working for other people. hehehehe
    correct me if i have given any incorrect steps for resolving the problem.

    By the way casey where are you from, can we talk in private if you do not mind

    Thank You,
    Vivek.

  12. #12
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    Quote Originally Posted by vivek
    Hey casey,

    It works for me perfectly, its not working for other people. hehehehe
    correct me if i have given any incorrect steps for resolving the problem.

    By the way casey where are you from, can we talk in private if you do not mind

    Thank You,
    Vivek.
    No, those are the correct steps. That's why I specifically told them to try your solution again. That is exactly how I have fixed it on a few different servers.

    Send me a pm if you wanna chat.

  13. #13
    Member mhbrands's Avatar
    Join Date
    Apr 2003
    Location
    Kansas
    Posts
    17

    Talking

    I had the same problem after the cpanel update. I downgraded back to stable and then rebuilt postgres... works great now
    Wheatland-Hosting.com
    a golden opportunity.

  14. #14
    Member
    Join Date
    Aug 2004
    Posts
    57

    Default

    Thanks, it works perfectly for me
    i think, it is useful to turn it to a HOWTO topic

  15. #15
    sv1
    sv1 is offline
    Member
    Join Date
    Aug 2003
    Posts
    140

    Default

    Worked like a charm!

Similar Threads & Tags
Similar threads

  1. Run Script when server starts
    By CoolMike in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-05-2008, 04:33 AM
  2. Server crashes when cpbackup starts
    By CoolMike in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-22-2006, 07:46 AM
  3. Apache starts wrongly
    By COOLover in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-07-2004, 03:17 AM
  4. CPanel doesn't create Postgres DB
    By Rafaelfpviana in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-03-2004, 11:14 AM
  5. Server Stops for a while and again starts
    By mitul in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-11-2003, 09:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube