[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 ...
随机推荐
- 【转】Java常量池详解
今天My partner问我一个让他头疼的Java question,求输出结果: /** * * @author DreamSea 2011-11-19 */ public class Intege ...
- 利用VMware在虚拟机上安装Zookeeper集群
http://blog.csdn.net/u010246789/article/details/52101026 利用VMware在虚拟机上安装Zookeeper集群 pasting
- 6.5笔记-DQL高级查询
一.高级查询 Exists Drop table if exists result; 子查询有返回结果: EXISTS子查询结果为TRUE 子查询无返回结果: EXISTS子查询结果为FALSE, 外 ...
- 39. Combination Sum + 40. Combination Sum II + 216. Combination Sum III + 377. Combination Sum IV
▶ 给定一个数组 和一个目标值.从该数组中选出若干项(项数不定),使他们的和等于目标值. ▶ 36. 数组元素无重复 ● 代码,初版,19 ms .从底向上的动态规划,但是转移方程比较智障(将待求数分 ...
- js网页倒计时精确到秒级
网页实时倒计时,精确到秒级,和天数倒计时原理一样. 一个很好用的js倒计时!网页实时倒计时,精确到秒级,和天数倒计时原理一样.js倒计时一般用于商城网站团购,特卖,很多地方都可用到!希望能够给大家带来 ...
- Nginx 前后端分离配置 分发
前端项目VUE 端口8081 , 后端项目JAVA 端口8080 # For more information on configuration, see: # * Official English ...
- editplus 链接FTP失败,超时
最近在用editplus链接服务器是出现了超时连接不上的情况 检查后发现FTP配置没问题 后来打开高级设置后发现没有配置端口号 配置后登陆成功
- CCS5配置使用GenCodecPkg生成CODEC SERVER
1. 引言 CCS5中集成了算法生成工具的插件,使用XDAIS Tools条目里面的GenAlg命令生成的算法框架如下: 不过,我没找到如何在CCS中使用这个工程.难不成要把这个框架文件放在Linux ...
- jquery 替换节点实例
描述: 要求用户选择一个自己不喜欢的商品 说明: 左边是商品列表,右面显示用户不喜欢的商品. 首先用选择器获得用户点击的元素,然后替换右面用户选择的不喜欢的商品. <!doctype html& ...
- zabbix 2.0 安装
2.0环境 采用Centos6.3_64位操作系统 Zabbix安装 Zabbix 2.0 for RHEL5: # rpm -ivh http://repo.zabbix.com/zabbix/2. ...