title: Postgresql startup failure
body: <p>I'm attempting to build a box via Fabric on Openstack. Part of the install involves installing and running PostgreSQL.</p>
  
  <p>This command works fine:</p>
  
  <pre><code>$ sudo service postgresql initdb 
  </code></pre>
  
  <p>This command fails:</p>
  
  <pre><code>$ sudo service postgresql start
  </code></pre>
  
  <p>Log output of failure shows no issues when I run this command:</p>
  
  <pre><code>$ cat /var/lib/pgsql/pgstartup.log  
  </code></pre>
  
  <p>This command shows the following messages:</p>
  
  <pre><code>$ cat /var/lib/pgsql/data/pg_log/postgresql-Wed.log
  </code></pre>
  
  <blockquote>
    <p>LOG:  could not open configuration file
    "/var/lib/pgsql/data/pg_hba.conf": Permission denied
        FATAL:  could not load pg_hba.conf</p>
  </blockquote>
  
  <p>My user while executing these commands has the following groups:</p>
  
  <pre><code>vagrant, wheel
  </code></pre>
  
  <p>My user is in the <code>sudoers</code> list under <code>/etc/sudoers</code> with these permissions:  </p>
  
  <pre><code>vagrant  ALL=(ALL) NOPASSWD: ALL
  </code></pre>
  
  <p>perms on <code>pgsql</code>:</p>
  
  <pre><code>[root@integration ~]# ls -ltr /var/lib/pgsql/
  total 12
  drwx------.  2 postgres postgres 4096 Sep 13  2012 backups
  -rw-------.  1 postgres postgres 1152 Jun 19 20:17 pgstartup.log
  drwx------. 12 postgres postgres 4096 Jun 19 20:19 data
  </code></pre>
  
  <p>and sub dir <code>data</code>:</p>
  
  <pre><code>[root@integration ~]# ls -ltr /var/lib/pgsql/data/
  total 76
  -rw-------. 1 postgres postgres     4 Jun 19 20:17 PG_VERSION
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_twophase
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_tblspc
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_stat_tmp
  drwx------. 4 postgres postgres  4096 Jun 19 20:17 pg_multixact
  -rw-------. 1 postgres postgres 16886 Jun 19 20:17 postgresql.conf
  -rw-------. 1 postgres postgres  1631 Jun 19 20:17 pg_ident.conf
  drwx------. 3 postgres postgres  4096 Jun 19 20:17 pg_xlog
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_subtrans
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_clog
  drwx------. 5 postgres postgres  4096 Jun 19 20:17 base
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 global
  -rw-------. 1 postgres postgres   241 Jun 19 20:17 pg_hba.conf
  drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_log
  -rw-------. 1 postgres postgres    57 Jun 19 20:19 postmaster.opts
  </code></pre>