RPM多種用法(舉例)及在CentOS中幹掉console-kit-daemon

 《RPM多種用法(舉例)及在CentOS中幹掉console-kit-daemon》

 2013-07-07     `



  今天優化系統的時候,發現有個佔用系統資源比較多的 console-kit-daemon 進程/線程

  爲了在CentOSv6.2系統當中消滅它(原來那玩意兒用於用戶快速切換),特在網上找了一些 RPM 命令的用法,記錄如下。

  ● 查看內存裏面的進程名字
     ps -eLf | more  一頁一頁地查看 (不光進程,線程也會列出來,注意中間那個L是大寫字母)



 ================================
 ● 一般常用的 安裝命令就是 rpm -ivh 軟件包名.rpm


 ● rpm 強制刪除  rpm -e 軟件包名 --nodeps

    --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 <http://bugs.centos.org>
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. 





 ● 好了,知道了包大致名稱,尋找一些究竟有多少個和他相關的已經安裝的包
 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





------------------------------------------------------
———————————————————————————
 ● 我們有一個安裝包, 在安裝前我們想知道他裏面究竟要安裝哪些文件到我們的系統當中去
rpm -qpl ConsoleKit-0.4.1-3.el6.i686.rpm

warning: ConsoleKit-0.4.1-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
/etc/ConsoleKit
/etc/ConsoleKit/run-seat.d
/etc/ConsoleKit/run-session.d
/etc/ConsoleKit/seats.d
/etc/ConsoleKit/seats.d/00-primary.seat
/etc/dbus-1/system.d/ConsoleKit.conf
/etc/event.d/ck-log-system-restart
/etc/event.d/ck-log-system-start
/etc/event.d/ck-log-system-stop
/usr/bin/ck-history
/usr/bin/ck-launch-session
/usr/bin/ck-list-sessions
/usr/lib/ConsoleKit
/usr/lib/ConsoleKit/run-seat.d
/usr/lib/ConsoleKit/run-session.d
/usr/lib/ConsoleKit/scripts
/usr/lib/ConsoleKit/scripts/ck-system-restart
/usr/lib/ConsoleKit/scripts/ck-system-stop
/usr/sbin/ck-log-system-restart
/usr/sbin/ck-log-system-start
/usr/sbin/ck-log-system-stop
/usr/sbin/console-kit-daemon
/usr/share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
/usr/share/doc/ConsoleKit-0.4.1
/usr/share/doc/ConsoleKit-0.4.1/AUTHORS
/usr/share/doc/ConsoleKit-0.4.1/COPYING
/usr/share/doc/ConsoleKit-0.4.1/NEWS
/usr/share/doc/ConsoleKit-0.4.1/README
/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
/var/log/ConsoleKit
/var/run/ConsoleKit 




 ● 當然, 用 rpm -qpi 參數可以查看該安裝包的 詳細信息。
rpm -qpi ConsoleKit-devel-0.4.1-3.el6.i686.rpm

warning: ConsoleKit-devel-0.4.1-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Name        : ConsoleKit-devel             Relocations: (not relocatable)
Version     : 0.4.1                             Vendor: CentOS
Release     : 3.el6                         Build Date: Thu 11 Nov 2010 05:55:19 AM CST
Install Date: (not installed)               Build Host: c5b2.bsys.dev.centos.org
Group       : Development/Libraries         Source RPM: ConsoleKit-0.4.1-3.el6.src.rpm
Size        : 39204                            License: MIT
Signature   : RSA/8, Sun 03 Jul 2011 12:03:00 PM CST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://www.freedesktop.org/wiki/Software/ConsoleKit
Summary     : Development files for ConsoleKit
Description :
This package contains headers and libraries needed for
developing software that is interacting with ConsoleKit.



 ● 完


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章