优化CentOS时,发现有个占用系统资源较多的console-kit-daemon进程, 经google了解到该进程作用是提供桌面端的一个"快速用户切换", 下面我们来看看如何杀掉console-kit-daemon进程:
● 查看内存里面的进程名字:
ps -eLf | more 一页一页地查看(不光进程,线程也会列出来,注意中间那个L是大写字母)
● 常用的安装命令就是:
rpm -ivh 软件包名.rpm
● rpm 强制删除:
rpm -e 软件包名 --nodeps --test 【--test 参数表示仅用于演习, 并没有真正执行删除或者安装】
● 找出执行文件路径:
which console-kit-daemon
/usr/sbin/console-kit-daemon
● 查看该文件属于哪个 RPM包
rpm -qif /usr/sbin/console-kit-daemon
Name : ConsoleKit Relocations: (not relocatable)
Version : 0.4.1 Vendor: CentOS
Release : 3.el6 Build Date: Thu 11 Nov 2010 02:50:34 AM CST
Install Date: Sat 29 Jun 2013 07:51:43 PM CST Build Host: c6b1.bsys.dev.centos.org
Group : System Environment/Libraries Source RPM: ConsoleKit-0.4.1-3.el6.src.rpm
Size : 252541 License: GPLv2+
Signature : RSA/8, Sun 03 Jul 2011 12:03:00 PM CST, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem
URL : http://www.freedesktop.org/wiki/Software/ConsoleKit
Summary : System daemon for tracking users, sessions and seats
Description :
ConsoleKit is a system daemon for tracking what users are logged
into the system and how they interact with the computer (e.g.
which keyboard and mouse they use).
It provides asynchronous notification via the system message bus.
● OK,知道了包大致名称,来看一看究竟有多少个和它相关的已经安装的包:
rpm -qa |grep ConsoleKit
ConsoleKit-libs-0.4.1-3.el6.i686
ConsoleKit-0.4.1-3.el6.i686
ConsoleKit-x11-0.4.1-3.el6.i686
● 最后再来看看该安装包下面究竟都有些什么文件(列出文件清单):
rpm -ql ConsoleKit-x11-0.4.1-3.el6.i686
/usr/libexec/ck-collect-session-info
/usr/libexec/ck-get-x11-display-device
/usr/libexec/ck-get-x11-server-pid