Fre*_*CHE 5 postgresql configuration-files root
我想更改postgresql.conf文件中的"shared_buffers"参数.
问题是我使用了sudo命令,它将所有权赋予root.
-rw-rw-rw- 1 root root 13661 Mar 14 15:36 postgresql.conf
Run Code Online (Sandbox Code Playgroud)
然后我使用以下命令将所有权归还给postmaster:
sudo chown postgres:postgres /var/lib/pgsql/data/postgresql.conf
Run Code Online (Sandbox Code Playgroud)
所以我尝试了这个命令:
postgres -D /var/lib/pgsql/data
Run Code Online (Sandbox Code Playgroud)
我仍然感到非常惊讶,仍然收到以下错误消息
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
Run Code Online (Sandbox Code Playgroud)
下面的id是postgreSQL中目录中"ls"命令的结果:
sudo ls -l /var/lib/pgsql/data/
total 208
drwx------ 19 postgres postgres 4096 Mar 13 17:23 base
drwx------ 2 postgres postgres 4096 Mar 14 14:30 global
drwx------ 2 postgres postgres 4096 Mar 5 14:26 pg_clog
-rw------- 1 postgres postgres 3365 Mar 1 2006 pg_hba.conf
-rw------- 1 postgres postgres 3182 Mar 1 2006 pg_hba.conf.old
-rw------- 1 postgres postgres 1460 Feb 24 2006 pg_ident.conf
drwx------ 2 postgres postgres 139264 Mar 14 00:00 pg_log
drwx------ 4 postgres postgres 4096 Feb 24 2006 pg_multixact
drwx------ 2 postgres postgres 4096 Mar 14 10:42 pg_subtrans
drwx------ 2 postgres postgres 4096 Feb 24 2006 pg_tblspc
drwx------ 2 postgres postgres 4096 Feb 24 2006 pg_twophase
-rw------- 1 postgres postgres 4 Feb 24 2006 PG_VERSION
drwx------ 3 postgres postgres 4096 Mar 14 14:30 pg_xlog
-rw-rw-rw- 1 postgres postgres 13661 Mar 14 15:36 postgresql.conf
-rw------- 1 postgres postgres 49 Jan 2 17:15 postmaster.opts
Run Code Online (Sandbox Code Playgroud)
如果有人知道可能是解决这个问题的方法.
提前致谢.
弗雷德
检查SELinux如何运行:
# sestatus
Run Code Online (Sandbox Code Playgroud)
如果它处于强制模式,请检查日志:
# less /var/log/audit/audit.log
Run Code Online (Sandbox Code Playgroud)
如果你发现SELinux阻塞,那么暂时禁用SELinux只是为了确认它是罪魁祸首:
# setenforce 0
Run Code Online (Sandbox Code Playgroud)
现在尝试启动服务器.如果它工作,然后重新启用SELinux:
# setenforce 1
Run Code Online (Sandbox Code Playgroud)
搜索如何恢复该文件的SELinux设置.
| 归档时间: |
|
| 查看次数: |
6901 次 |
| 最近记录: |