1

When trying to start PostgreSQL, I get this 'empty' error message:

root@mountain-lion:/home/ubuntu# service postgresql start
 * Starting PostgreSQL 9.1 database server
 * Error: could not exec /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /vol/postgres -l /var/log/postgresql/postgresql-9.1-main.log -s -o  -c config_file="/etc/postgresql/9.1/main/postgresql.conf" : 

This is a freshly installed Ubuntu 11.10 server (on EC2 / Scalarium), with postgresql-9.1 just installed via apt-get.

There's one change configuration value in postgresql.conf:

data_directory = '/vol/postgres'

/vol/postgres looks like this

drwx------ 5 postgres postgres   38 2012-05-18 15:13 base
drwx------ 2 postgres postgres 4096 2012-05-18 15:13 global
drwx------ 2 postgres postgres   17 2012-05-18 15:12 pg_clog
drwx------ 4 postgres postgres   34 2012-05-18 15:12 pg_multixact
drwx------ 2 postgres postgres   17 2012-05-18 15:13 pg_notify
drwx------ 2 postgres postgres    6 2012-05-18 15:12 pg_serial
drwx------ 2 postgres postgres   24 2012-05-18 15:13 pg_stat_tmp
drwx------ 2 postgres postgres   17 2012-05-18 15:12 pg_subtrans
drwx------ 2 postgres postgres    6 2012-05-18 15:12 pg_tblspc
drwx------ 2 postgres postgres    6 2012-05-18 15:12 pg_twophase
-rw------- 1 postgres postgres    4 2012-05-18 15:12 PG_VERSION
drwx------ 3 postgres postgres   58 2012-05-18 15:12 pg_xlog
-rw------- 1 postgres postgres  133 2012-05-18 15:13 postmaster.opts
lrwxrwxrwx 1 root     root       36 2012-05-18 15:13 server.crt -> /etc/ssl/certs/ssl-cert-snakeoil.pem
lrwxrwxrwx 1 root     root       38 2012-05-18 15:13 server.key -> /etc/ssl/private/ssl-cert-snakeoil.key

Any idea?

Update: When I set data_directory to the default (/var/lib/postgresql/9.1/main) it works fine, so there must be something wrong in that specific change.

4
  • 1
    Could you verify the permissions of /vol/postgres itself? ls -lha /vol/postgres May 25, 2012 at 6:44
  • @AntonisChristofides drwxr-xr-x 14 root root, also it's a mount point. May 25, 2012 at 7:46
  • @AntonisChristofides You pointed me in the right direction (see my answer). If you post an answer, I'll accept it. May 25, 2012 at 7:53
  • That's OK, thanks, accept your own answer. Just flatter my comment above instead. May 25, 2012 at 8:09

1 Answer 1

1

Fixed. First I changed the owner of /vol/postgres to postgres (after comments on the question). This resulted in the following understandable error:

 * The PostgreSQL server failed to start. Please check the log output:
2012-05-25 07:50:13 GMT FATAL:  data directory "/vol/postgres" has group or world access
2012-05-25 07:50:13 GMT DETAIL:  Permissions should be u=rwx (0700).

So I did what it says and now it starts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .