Yukiharu YABUKI の tDiary
このtDiaryを検索します。
2011-08-05 [長年日記]
_ pmap
procps: /usr/bin/pmap procps: /usr/share/man/man1/pmap.1.gzbashのプロセスで利用しているメモリーマップ。見ているだけで色々と疑問点が出てくる。 何かで似たような出力結果を見たような気がするが、ちょっと思い出せないな。ライブラリ 関係のコマンドだったような。
$ pmap -x 2965 2965: /bin/bash Address Kbytes RSS Dirty Mode Mapping 08048000 0 600 0 r-x-- bash 0810a000 0 20 20 rw--- bash 0810f000 0 20 20 rw--- [ anon ] 09124000 0 1980 1980 rw--- [ anon ] b73a1000 0 12 0 r-x-- libnss_files-2.11.2.so b73ab000 0 0 0 r---- libnss_files-2.11.2.so b73ac000 0 0 0 rw--- libnss_files-2.11.2.so b73ad000 0 16 0 r-x-- libnss_nis-2.11.2.so b73b5000 0 0 0 r---- libnss_nis-2.11.2.so b73b6000 0 0 0 rw--- libnss_nis-2.11.2.so b73b7000 0 20 0 r-x-- libnsl-2.11.2.so b73ca000 0 0 0 r---- libnsl-2.11.2.so b73cb000 0 0 0 rw--- libnsl-2.11.2.so b73cc000 0 0 0 rw--- [ anon ] b73ce000 0 16 0 r-x-- libnss_compat-2.11.2.so b73d4000 0 0 0 r---- libnss_compat-2.11.2.so b73d5000 0 0 0 rw--- libnss_compat-2.11.2.so b73d6000 0 48 0 r---- locale-archive b74c5000 0 8 0 r---- locale-archive b76c5000 0 4 4 rw--- [ anon ] b76c6000 0 488 0 r-x-- libc-2.11.2.so b7806000 0 4 4 r---- libc-2.11.2.so b7808000 0 4 4 rw--- libc-2.11.2.so b7809000 0 12 12 rw--- [ anon ] b780d000 0 8 0 r-x-- libdl-2.11.2.so b780f000 0 4 4 r---- libdl-2.11.2.so b7810000 0 0 0 rw--- libdl-2.11.2.so b7811000 0 68 0 r-x-- libncurses.so.5.7 b7848000 0 8 8 rw--- libncurses.so.5.7 b785f000 0 0 0 r---- bash.mo b7861000 0 20 0 r--s- gconv-modules.cache b7868000 0 4 4 rw--- [ anon ] b786a000 0 4 0 r-x-- [ anon ] b786b000 0 100 0 r-x-- ld-2.11.2.so b7886000 0 4 4 r---- ld-2.11.2.so b7887000 0 4 4 rw--- ld-2.11.2.so bfb9f000 0 20 20 rw--- [ stack ] -------- ------- ------- ------- ------- total kB 9252 - - -
$ pmap -d 2965 2965: /bin/bash Address Kbytes Mode Offset Device Mapping 08048000 776 r-x-- 0000000000000000 0fe:00001 bash 0810a000 20 rw--- 00000000000c1000 0fe:00001 bash 0810f000 20 rw--- 0000000000000000 000:00000 [ anon ] 09124000 3364 rw--- 0000000000000000 000:00000 [ anon ] b73a1000 40 r-x-- 0000000000000000 0fe:00001 libnss_files-2.11.2.so b73ab000 4 r---- 0000000000009000 0fe:00001 libnss_files-2.11.2.so b73ac000 4 rw--- 000000000000a000 0fe:00001 libnss_files-2.11.2.so b73ad000 32 r-x-- 0000000000000000 0fe:00001 libnss_nis-2.11.2.so b73b5000 4 r---- 0000000000008000 0fe:00001 libnss_nis-2.11.2.so b73b6000 4 rw--- 0000000000009000 0fe:00001 libnss_nis-2.11.2.so b73b7000 76 r-x-- 0000000000000000 0fe:00001 libnsl-2.11.2.so b73ca000 4 r---- 0000000000012000 0fe:00001 libnsl-2.11.2.so b73cb000 4 rw--- 0000000000013000 0fe:00001 libnsl-2.11.2.so b73cc000 8 rw--- 0000000000000000 000:00000 [ anon ] b73ce000 24 r-x-- 0000000000000000 0fe:00001 libnss_compat-2.11.2.so b73d4000 4 r---- 0000000000006000 0fe:00001 libnss_compat-2.11.2.so b73d5000 4 rw--- 0000000000007000 0fe:00001 libnss_compat-2.11.2.so b73d6000 956 r---- 00000000048a7000 0fe:00001 locale-archive b74c5000 2048 r---- 0000000000000000 0fe:00001 locale-archive b76c5000 4 rw--- 0000000000000000 000:00000 [ anon ] b76c6000 1280 r-x-- 0000000000000000 0fe:00001 libc-2.11.2.so b7806000 8 r---- 000000000013f000 0fe:00001 libc-2.11.2.so b7808000 4 rw--- 0000000000141000 0fe:00001 libc-2.11.2.so b7809000 16 rw--- 0000000000000000 000:00000 [ anon ] b780d000 8 r-x-- 0000000000000000 0fe:00001 libdl-2.11.2.so b780f000 4 r---- 0000000000001000 0fe:00001 libdl-2.11.2.so b7810000 4 rw--- 0000000000002000 0fe:00001 libdl-2.11.2.so b7811000 220 r-x-- 0000000000000000 0fe:00001 libncurses.so.5.7 b7848000 12 rw--- 0000000000036000 0fe:00001 libncurses.so.5.7 b785f000 8 r---- 0000000000000000 0fe:00001 bash.mo b7861000 28 r--s- 0000000000000000 0fe:00001 gconv-modules.cache b7868000 8 rw--- 0000000000000000 000:00000 [ anon ] b786a000 4 r-x-- 0000000000000000 000:00000 [ anon ] b786b000 108 r-x-- 0000000000000000 0fe:00001 ld-2.11.2.so b7886000 4 r---- 000000000001a000 0fe:00001 ld-2.11.2.so b7887000 4 rw--- 000000000001b000 0fe:00001 ld-2.11.2.so bfb9f000 132 rw--- 0000000000000000 000:00000 [ stack ] mapped: 9252K writeable/private: 3612K shared: 28K
_ rpcinfo
$ dpkg -S rpcinfo libc-bin: /usr/share/man/man8/rpcinfo.8.gz manpages-ja: /usr/share/man/ja/man8/rpcinfo.8.gz libc-bin: /usr/bin/rpcinfo nmap: /usr/share/nmap/scripts/rpcinfo.nse
$ dpkg -S pmap_dump portmap: /usr/share/man/man8/pmap_dump.8.gz portmap: /sbin/pmap_dump
$ rpcinfo -p localhost プログラム バージョン プロトコル ポート 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 44486 status 100024 1 tcp 34125 status $ sudo pmap_dump [sudo] password for yabuki: 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 44486 status 100024 1 tcp 34125 status
_ TCP/UDPのサービス名対応は
/etc/serivces をそのまま見るもよし getent や grep を使うのも良いかと。