[Postgres]postgresql.conf : Permission denied处理一法
使用yum安装完postgresql,没有使用默认的DATA地址,自己配置了DATA地址以后,使用root权限启动service
service postgresql start
,报出了"FAILED"
不解,检查Log文件 /var/lib/pgsql/pgstartup.log. 发现如下记录
postmaster cannot access the server configuration file
"/var/lib/pgsql/data/postgresql.conf": Permission denied
于是检查postgres用户的文件权限,没有明显的问题,可读可写(忘了好像是700),于是上网一查,基本怀疑问题在SELinux上
先检查SELinux状态
# sestatus
SELinux status: enabledSELinuxfs mount: /selinuxCurrent mode: enforcingMode from config file: enforcingPolicy version: 21Policy from config file: targeted果然是运行状态,并且还是在"enforcing"模式,检查SELinux的Log(大部分情况在/var/log/audit/,有时也会被配置到/var/log/messages)
# grep postgres /var/log/audit/audit.log | grep denied | tail -1type=AVC msg=audit(1234567890.334:432): avc: denied { read } forpid=1234 comm="postmaster" name="pgsql" dev=newpgdisk ino=403123 scontext=user_u:system_r:postgresql_t:s0tcontext=system_u:object_r:var_lib_t:s0 tclass=lnk_file有一条拒绝记录!就这玩意干的。
这里说个最简单干脆的方法,停用SELinux.
编辑/etc/selinux/config:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
将SELINUX=enforcing 改成 SELINUX=permissive或者SELINUX=disabled,重启系统
再次启动postgresql,问题解决
可参考:http://blog.endpoint.com/2009/09/permission-denied-for-postgresqlconf.html
http://www.crypt.gen.nz/selinux/disable_selinux.html
http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
[Postgres]postgresql.conf : Permission denied处理一法的更多相关文章
- Postgresql ERROR: permission denied for relation app_info
启用终端,: 进入mydb数据库:\c mydb 然后给当前数据库的角色赋予权限:GRANT ALL PRIVILEGES ON TABLE 表名 TO 角色名;
- docker postgresql FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
在docker中启动postgresql时出现错误 FATAL: could not access private key file "/etc/ssl/private/ssl-cert- ...
- Apache Permission denied (httpd.conf配置和目录权限无问题)解决办法
今天在CentOS5.9中配置zabbix时出现错误:Apache 403 error, (13)Permission denied: access to / denied 检查了一圈httpd.co ...
- postgresql connection failure:SQLSTATE[08006] [7] could not connect to server: Permission denied Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
PHP 程序无法连接到 CentOS 上的PostgreSQL,但是在 CentOS 服务器上却能正常运行 psql, 操作如下:多次重启 PG 数据库后发现 CGI 脚本无法连接数据库,但是可以使用 ...
- Understanding postgresql.conf : log*
After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...
- vsftpd安装配置 530 Permission denied.错误
yum install vsftpd service vsftpd start 530 Permission denied.错误 /etc/vsftpd/user_list 该文件里的用户账户在 ...
- [转]HDFS客户端的权限错误:Permission denied
搭建了一个Hadoop的环境,Hadoop集群环境部署在几个Linux服务器上,现在想使用windows上的Java客户端来操作集群中的HDFS文件,但是在客户端运行时出现了如下的认证错误. 错误的详 ...
- org.apache.hadoop.security.AccessControlException: Permission denied:
org.apache.hadoop.security.AccessControlException: Permission denied: user=xxj, access=WRITE, inode= ...
- 解决mac os x下 tomcat启动报 java.net.BindException: Permission denied <null>:80 错误
我在mac os x上启动tomcat的时候,报 java.net.BindException: Permission denied <null>:80,java.net.BindExce ...
随机推荐
- USACO 2016 US Open Contest, Gold解题报告
1.Splitting the Field http://usaco.org/index.php?page=viewproblem2&cpid=645 给二维坐标系中的n个点,求ans=用一个 ...
- Spring cloud 之Feign基本使用
首先导入feign的依赖: <!-- 添加feign声明式webservice client --> <dependence> <groupId>org.sprin ...
- [html]window.open 使用示例
<!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...
- pythonNet day03
TCP应用之 httpserver 1.接收http请求 2.查看http请求 3.返回一个网页给客户端 # 做的是一个本地服务端,接收来自浏览器客户端的请求 from socket import * ...
- 接口自动化(二)--操作Excel获取需要数据
这一部分的内容记述一下对Excel表格的操作,本实战中的测试用例是由Excel来管理的,因此操作Excel是重要的一部分. 再次贴出这张图,所有的测试用例都在这个sheet内,请求数据真实存放在jso ...
- fadora24安装settools,pip包出错解决方法
1.fadora24安装Python2.7 [root@dev ~]# python bash: python: 未找到命令... 安装软件包“python”以提供命令“python”? [N/y] ...
- Spring IO Platform介绍
为什么要用Spring IO Platform 今天无意间看到了一个关键词:"Spring IO Platform",第一直觉是不是有关于IO方面的框架或者包呢,查了一下,居然是为 ...
- j2ee常用jar包
[b]activation.jar:[/b]与javaMail有关的jar包,使用javaMail时应与mail.jar一起加入到lib中去,具体负责mail的数据源和类型等 [b]ajaxtags- ...
- 4-30 HTML 细节摘录
<b> 定义粗体文本. <big> 定义大号字. <em> 定义着重文字. <i> 定义斜体字. <small> 定义小号字. <s ...
- better-scroll的用法,及其中的一个属性event._constructed详解
better-scroll是一个页面滚动插件,用它可以很方便的实现下拉刷新,锚点滚动等功能. 实现原理:父容器固定高度,并设置overflow:hidden,子元素超出父元素高度后将被隐藏,超出部分可 ...