我正在尝试通过 Openstack 上的 Fabric 构建一个盒子。安装的一部分涉及安装和运行 PostgreSQL。
此命令工作正常:
$ sudo service postgresql initdb
此命令失败:
$ sudo service postgresql start
当我运行此命令时,失败的日志输出显示没有问题:
$ cat /var/lib/pgsql/pgstartup.log
此命令显示以下消息:
$ cat /var/lib/pgsql/data/pg_log/postgresql-Wed.log
日志:无法打开配置文件“/var/lib/pgsql/data/pg_hba.conf”:权限被拒绝致命:无法加载 pg_hba.conf
我的用户在执行这些命令时具有以下组:
vagrant, wheel
我的用户在具有以下权限 的sudoers
列表中:/etc/sudoers
vagrant ALL=(ALL) NOPASSWD: ALL
烫发pgsql
:
[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
和子目录data
:
[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