Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    13

    Unanswered: Could not open postmaster.pid: permission denied

    So I have a NAS which has some disks connected via USB to it and on one of those disks I have my database directory. I also have a low power GuruPlug on which I wish to start up the postgresql server so I can use the databases on it.

    Everything on my NAS is setup so I can access it's USB disks wirelessly, so I've mounted the necessary partition with this line.

    Code:
    mount.cifs //192.168.0.102/Data /mnt/Data -o uid=postgres,forceuid,user=username,password=password,domain=MyLAN,noperm
    I don't have access to chmod, chown or chgrp on the Plug so I have to do that on the NAS. Since the postgres user doesn't exist there, I've just used it's UID.

    So as per a website I found, I've used chmod on the directory in question.

    Code:
    drwx------   13 107      users         4096 Jul  6 21:40 PostgreSQL
    107 is the uid of the postgres account on the Plug. However, doing so means I can't do a ls of the files inside the directory on my Plug, even as root. Here is the same listing from the Plug.

    Code:
    drwx------ 13 postgres users 0 Jul  6 21:40 PostgreSQL
    So I do su - postgres, and then run this.

    Code:
    ./pg_ctl start -D /mnt/Data/Databases/PostgreSQL
    But then I get this error.

    Code:
    pg_ctl: could not open PID file "/mnt/Data/Databases/PostgreSQL/postmaster.pid": Permission denied
    I simply don't get it, because as far as I can tell everything is correct, the permissions are as they should be. So what could I possibly be doing wrong?

  2. #2
    Join Date
    Apr 2012
    Posts
    13
    I've solved it myself now. As it turns out, the problem was that while I had run chown on the PostgreSQL directory, the parent directories had a different owner than the one I used to mount it with. After changing the owner on the entire directory, I can now start the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •