为什么我的postgres进程仍在运行?

时间:2012-03-01 10:32:42

标签: postgresql

我使用'sudo apt-get autoremove postgres'来卸载本地服务器上的postgresql数据库。我使用'sudo netstat -anpt'来找到postgres仍在那里并且正在运行?为什么?有人纠正我的理解吗?

2 个答案:

答案 0 :(得分:1)

您可以尝试手动卸载(以root身份,假设默认安装路径):

/opt/PostgreSQL/8.3/installer/server/removeshortcuts.sh /opt/PostgreSQL/8.3 8.3
/etc/init.d postgresql-8.3 stop
rm -rf /opt/PostgreSQL
rm /etc/postgres-reg.ini
rm -rf /etc/init.d/postgresql-8.3
userdel postgres

if /etc/ld.so.conf exists, edit it and remove /opt/PostgreSQL/8.3/lib
if present.

if /etc/ld.so.conf.d exists:

rm /etc/ld.so.conf.d/postgresql-8.3.conf 

答案 1 :(得分:0)

这是因为正在运行的进程在内存中,因此它独立于磁盘上发生的事情。只有当正在运行的进程需要加载已被删除的东西时才重要。您需要做的就是找到流程ID(ps -aux),然后找到kill -9 <pid>

相关问题