LoginSignup
1
0

More than 5 years have passed since last update.

yum ps 不具合調査

Last updated at Posted at 2018-04-20

問題点

  • 「yum-plugin-ps-1.1.31-40.29(現時点で最新)」をインストール
  • 環境によってコマンド「yum ps」、「yum ps all」の結果がおかしい
    • 特定の常駐プロセスに関するパッケージが表示されない(cron、ntpd等)
    • 表示されているプロセスに関しても共有ライブラリに関連するパッケージが表示されていない
    • 手持ちの物理マシンやVirtualBoxにインストールした環境では正常に結果が出る。試した中で発生したのはAWS EC2上、IDCF上で動作しているインスタンスの場合のみ?仮想環境が関係?
    • 試したOSはAmazonLinux、RedHat、CentOS、かつバージョン関係なくどれでも発生する。

調査

該当メソッド

rpmdb_return_running_packages

get_open_files(pid)

[root@localhost ~]# cat /proc/979/maps
55c2bbf2a000-55c2bbff2000 r-xp 00000000 fd:00 35048846                   /usr/sbin/sshd
55c2bc1f1000-55c2bc1f5000 r--p 000c7000 fd:00 35048846                   /usr/sbin/sshd
55c2bc1f5000-55c2bc1f6000 rw-p 000cb000 fd:00 35048846                   /usr/sbin/sshd
55c2bc1f6000-55c2bc1ff000 rw-p 00000000 00:00 0 
55c2be112000-55c2be133000 rw-p 00000000 00:00 0                          [heap]
7ff2c8761000-7ff2c876d000 r-xp 00000000 fd:00 33605543                   /usr/lib64/libnss_files-2.17.so
7ff2c876d000-7ff2c896c000 ---p 0000c000 fd:00 33605543                   /usr/lib64/libnss_files-2.17.so
7ff2c896c000-7ff2c896d000 r--p 0000b000 fd:00 33605543                   /usr/lib64/libnss_files-2.17.so
7ff2c896d000-7ff2c896e000 rw-p 0000c000 fd:00 33605543                   /usr/lib64/libnss_files-2.17.so
7ff2c896e000-7ff2c8974000 rw-p 00000000 00:00 0 
7ff2c8974000-7ff2c8983000 r-xp 00000000 fd:00 33625864                   /usr/lib64/libbz2.so.1.0.6
AWS上のインスタンス
# cat /proc/2475/maps
                                       ↓★★★↓
564e59cd2000-564e59d98000 r-xp 00000000 ca:01 12567                      /usr/sbin/sshd
564e59f97000-564e59f9b000 r--p 000c5000 ca:01 12567                      /usr/sbin/sshd
564e59f9b000-564e59f9c000 rw-p 000c9000 ca:01 12567                      /usr/sbin/sshd
564e59f9c000-564e59fa5000 rw-p 00000000 00:00 0 
564e5a45c000-564e5a47d000 rw-p 00000000 00:00 0                          [heap]
7f09f38f8000-7f09f3904000 r-xp 00000000 ca:01 271911                     /lib64/libnss_files-2.17.so
7f09f3904000-7f09f3b03000 ---p 0000c000 ca:01 271911                     /lib64/libnss_files-2.17.so
[root@localhost 655]# more cmdline 
/usr/sbin/crond

[root@localhost 655]# uname -a
Linux localhost.localdomain 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost 655]# more /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@ip-192-168-0-188 2568]# more cmdline 
crond

[root@ip-192-168-0-188 2568]# uname -a
Linux ip-192-168-0-188 4.9.75-25.55.amzn1.x86_64 #1 SMP Fri Jan 5 23:50:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@ip-192-168-0-188 2568]# more /etc/system-release
Amazon Linux AMI release 2017.03

※同じ環境でもフルパスになっているものもある
# cat /proc/2410/cmdline
/usr/sbin/acpid

対応

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0