PostgreSQL服务无法停止/启动/重启

问题描述:

我在运行PostGreSQL 9.3的CentOS 6.5上,并且当我运行命令 service postgresql-9.3 stop 时,我得到的[OK]好像已经停止了,但是服务是仍然运行或停止时自动启动,因为我可以一遍又一遍地运行 service postgresql-9.3 stop 并始终获得[OK],就好像它已停止一样。尝试启动或重新启动会显示[FAILED]消息。我该如何阻止呢?尝试运行 rake db:setup 时,出现错误消息 FATAL:无法创建任何TCP / IP套接字 >对于我的rails项目。 / tmp目录中没有用于PrestGreSQL的套接字文件,但是PG似乎认为存在。我的想法是卸载postgres并进行全新安装,但我需要停止该服务才能使其正常运行。感谢所有帮助。

I am on CentOS 6.5 running PostGreSQL 9.3 and when I run the command service postgresql-9.3 stop I get the [ OK ] as if it has stopped but the service is either still running or starts automatically when it is stopped because I can run the service postgresql-9.3 stop over and over again and always get the [ OK ] as if it has been stopped. Trying to start or restart gives the [FAILED] message. How can I stop this? I get an error that says FATAL: could not create any TCP/IP sockets when I try to run rake db:setup for my rails project. There is no socket file in the /tmp directory for PrestGreSQL but it seems like PG thinks there is. I had the idea to uninstall postgres and do a fresh install but I need to stop the service in order for it to work. Any help is appreciated.

检查服务的状态信息

服务postgresql-9.1的状态

如果服务已停止,请找到任何僵尸进程并杀死

ps -ef | grep postgres

Check the stauts of the service
service postgresql-9.1 status
If service already stopped, find any zombie process and kill
ps -ef | grep postgres