The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

update_db_cache ignoring PostgreSQL state

Discussion in 'Database Discussions' started by Kent Brockman, Jul 25, 2010.

  1. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi! I have deactivated PostgreSQL in my server because we don't use it at all, and today I've activated the option "Calculate the disk usage of account MySQL and PostgreSQL databases." at Tweak Settings, and since then, we are receiving a cron alert email with subject "Cron <root@servidor> /usr/bin/test -x /scripts/update_db_cache && /scripts/update_db_cache", and this content:

    Code:
    psql: could not connect to server: No such file or directory
    	Is the server running locally and accepting
    	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
    May be possible that update_db_cache script is not checking whether PostgreSQL is running/available? how to fix this?
     
  2. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    When you removed PostgreSQL, did you remove the rpms as well? If not, please try to remove them using the following:

    Code:
    rpm -qa|grep -i postgres
    If the rpms are still there, you may receive a list similar to the following (this is from my machine):

    Code:
    postgresql-7.4.29-1.el4_8.1
    postgresql-server-7.4.29-1.el4_8.1
    postgresql-devel-7.4.29-1.el4_8.1
    postgresql-libs-7.4.29-1.el4_8.1
    You could then remove the rpms in this order:

    Code:
    rpm -e postgresql-server-7.4.29-1.el4_8.1
    rpm -e postgresql-devel-7.4.29-1.el4_8.1
    rpm -e postgresql-7.4.29-1.el4_8.1
    rpm -e postgresql-libs-7.4.29-1.el4_8.1
    After removing the rpms, you could also move the /var/lib/pgsql folder if it still exists (or remove the folder). I believe that the rpms and the folder are the methods the script checks for whether PostgreSQL is installed on the system still. Because it's finding the rpms, it will keep trying to check the usage.
     
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yep, I thought about it but I have my doubts.
    - Should I definitely delete PostgreSQL?
    - Can I do that without causing any harm to any part of the system?

    Notice that the latest screen of Easy Apache clearly state that pgsql need to be included to assure a good cpphp compatibility (see the attached image).
    That's why I'm wondering if I also should deactivate those options in Easy Apache and recompile Apache before applying your solution.

    Any suggestion is welcome.
     

    Attached Files:

  4. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    You can remove it in EasyApache first, since it never hurts to remove it in EasyApache, but the only way to have the emails stop outputting errors is to remove those rpms.

    Also, cpphp only uses postgres if you have postgres installed for PhpPgAdmin and adding the databases. cPanel doesn't run on postgres.
     
  5. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Done. rpms deleted succesfully.

    I see old postgres-db-count files in the ".cpanel/datastore/" dir of every account. Most of them have dates from 2008... is it safe to delete them?
     
  6. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    The files in /home/user/.cpanel are mainly for caching purposes. There's no real reason to remove them unless you need to remove them. I wouldn't touch them unless it's causing the wrong information to output in the people's cPanel or causing some other issue. cPanel won't be looking there for the script.

    Now, /var/lib/pgsql itself shouldn't exist, though, as I mentioned in my initial reply, so if that's still on the machine, you'd want to move the file to /var/lib/pgsql.bak or some other name.

    One final point that I didn't mention earlier as I'd think it wouldn't be on the system anymore, but it might be and you'd want to move it as well:

    /usr/bin/postgres

    If that's on your machine, you'll want to move it out of /usr/bin to /root/postgres.bak or somewhere else. Of note, I'm very against removing components. The rpms aren't a big deal as you can grab them again easily, but these others aren't so easy to bring back into place if you change your mind that you would like postgres again.
     
    #6 Miraenda, Jul 30, 2010
    Last edited: Jul 30, 2010
  7. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    /usr/bin/postgres is not ther. Surely was deleted altogether with the rpms.
    The check error stopped coming. All ok. Happiness :)
     
  8. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    Great to hear :)
     
Loading...
Similar Threads - update_db_cache ignoring PostgreSQL
  1. Jerms
    Replies:
    3
    Views:
    906

Share This Page