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.

PostgreSql backup failure

Discussion in 'General Discussion' started by serg, Jan 25, 2008.

  1. serg

    serg Member

    Joined:
    May 30, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    OS: FreeBSD 6.2
    WHM 11.15.0 cPanel 11.17.0-R19434
    Previous releases have absolutely the same issue.

    /scripts/pkgacct generate an account backup,
    however, as I find out, there is a problem with postgresql databases backups

    Here is an error message logged:
    pg_dump: [tar archiver] could not generate temporary file name: Permission denied

    This happen because of incorrect user switching.

    pg_dump called by pgsql user but within domain USER environment.
    In that case TMPDIR variable is set to /HOME/USER/tmp but the USER is the only one who is granted to write there, therefore pg_dump unable to create tmpfile inside this directory.

    Possible fixes:
    1. run pg_dump as USER
    or
    2. export TMPDIR variable with proper value, /tmp for example.

    2nd choise is quite easy to be implemented by the end user untill cpanel fix this issue.

    You just need to do following:
    1. mv /usr/local/bin/pg_dump /usr/local/bin/pg_dump_real
    2. create new file /usr/local/bin/pg_dump with following contect
    export TMPDIR=/tmp ; pg_dump_real $@
    3. set this file to be executable, i.e. chmod a+x /usr/local/bin/pg_dump
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Thanks for the report. The developers have been informed of this matter.
     
  3. serg

    serg Member

    Joined:
    May 30, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Another issue related to database restoration.

    Ownerships/permissions are not restored properly.

    Here is how to reproduce it:
    1. Create postgres database via cpanel
    2. Create user
    3. assign user to database
    4. login to postgres as this user
    5. create a table - this user will be the owner of it.
    6. transfer account to different host.

    all tables/objects will be owned by "domainadmin" account instead of right postgres account.
     
Loading...

Share This Page