LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-25-2021, 02:53 AM   #1
linuly
Member
 
Registered: Jan 2018
Posts: 96

Rep: Reputation: Disabled
ldd


hi,
Code:
ldd /usr/sbin/named
        linux-vdso.so.1 =>  (0x00007fff79692000)
        liblwres.so.160 => /lib64/liblwres.so.160 (0x00007f644f481000)
        libdns.so.1102 => /lib64/libdns.so.1102 (0x00007f644f049000)
        libbind9.so.160 => /lib64/libbind9.so.160 (0x00007f644ee39000)
        libisccfg.so.160 => /lib64/libisccfg.so.160 (0x00007f644ec0b000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f644e9be000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f644e6d5000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f644e4a2000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f644e29e000)
        libisccc.so.160 => /lib64/libisccc.so.160 (0x00007f644e093000)
        libisc.so.169 => /lib64/libisc.so.169 (0x00007f644de16000)
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f644d9b3000)
        libcap.so.2 => /lib64/libcap.so.2 (0x00007f644d7ae000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f644d592000)
        libGeoIP.so.1 => /lib64/libGeoIP.so.1 (0x00007f644d362000)
        libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f644cff8000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f644cde2000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f644cae0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f644c8dc000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f644c50e000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f644c2fe000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f644c0fa000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f644bee0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f644f959000)
        libattr.so.1 => /lib64/libattr.so.1 (0x00007f644bcdb000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f644bab5000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f644b88e000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f644b62c000)
and
 lsof -p 1439|grep .so
named   1439 named  mem       REG              253,0    37168     6792 /usr/lib64/libnss_sss.so.2
named   1439 named  mem       REG              253,0    61560    41770 /usr/lib64/libnss_files-2.17.so
named   1439 named  mem       REG              253,0   402384    42119 /usr/lib64/libpcre.so.1.2.0
named   1439 named  mem       REG              253,0   155744    42128 /usr/lib64/libselinux.so.1
named   1439 named  mem       REG              253,0   157424    42139 /usr/lib64/liblzma.so.5.2.2
named   1439 named  mem       REG              253,0    19896    85820 /usr/lib64/libattr.so.1.1.0
named   1439 named  mem       REG              253,0   109976   386239 /usr/lib64/libresolv-2.17.so
named   1439 named  mem       REG              253,0    15688    91050 /usr/lib64/libkeyutils.so.1.5
named   1439 named  mem       REG              253,0    67104   263574 /usr/lib64/libkrb5support.so.0.1
named   1439 named  mem       REG              253,0  2156344    41745 /usr/lib64/libc-2.17.so
named   1439 named  mem       REG              253,0    19248    41752 /usr/lib64/libdl-2.17.so
named   1439 named  mem       REG              253,0  1136944    41755 /usr/lib64/libm-2.17.so
named   1439 named  mem       REG              253,0    90248    42131 /usr/lib64/libz.so.1.2.7
named   1439 named  mem       REG              253,0  1509528    85787 /usr/lib64/libxml2.so.2.9.1
named   1439 named  mem       REG              253,0   197088     6840 /usr/lib64/libGeoIP.so.1.5.0
named   1439 named  mem       REG              253,0   142144   386089 /usr/lib64/libpthread-2.17.so
named   1439 named  mem       REG              253,0    20048    85824 /usr/lib64/libcap.so.2.22
named   1439 named  mem       REG              253,0  2520768     6030 /usr/lib64/libcrypto.so.1.0.2k
named   1439 named  mem       REG              253,0   517360     6846 /usr/lib64/libisc.so.169.0.3
named   1439 named  mem       REG              253,0    45544     6852 /usr/lib64/libisccc.so.160.0.3
named   1439 named  mem       REG              253,0    15856    42141 /usr/lib64/libcom_err.so.2.1
named   1439 named  mem       REG              253,0   210784   263566 /usr/lib64/libk5crypto.so.3.1
named   1439 named  mem       REG              253,0   967840   263572 /usr/lib64/libkrb5.so.3.3
named   1439 named  mem       REG              253,0   320720   263562 /usr/lib64/libgssapi_krb5.so.2.2
named   1439 named  mem       REG              253,0   187264     6848 /usr/lib64/libisccfg.so.160.2.1
named   1439 named  mem       REG              253,0    65408     6850 /usr/lib64/libbind9.so.160.0.8
named   1439 named  mem       REG              253,0  2345592     6842 /usr/lib64/libdns.so.1102.1.2
named   1439 named  mem       REG              253,0    78272     6854 /usr/lib64/liblwres.so.160.0.2
named   1439 named  mem       REG              253,0   163312   386276 /usr/lib64/ld-2.17.so
where
ps -ef|grep named
named 1439 1 0 03:26 ? 00:00:01 /usr/sbin/named -u named -c /etc/named.conf

i expected that all the so libraries showed on ldd command to be opened when named run.but i see from lsof that only a part of them.
why this?

Code:
 ls -l /proc/1439/fd
total 0
lrwx------. 1 named named 64 Mar 25 03:40 0 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 1 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 10 -> anon_inode:[eventpoll]
lr-x------. 1 named named 64 Mar 25 03:40 11 -> /usr/share/GeoIP/GeoIP-initial.dat
lr-x------. 1 named named 64 Mar 25 03:40 12 -> /usr/share/GeoIP/GeoIPv6-initial.dat
lr-x------. 1 named named 64 Mar 25 03:40 13 -> /dev/random
l-wx------. 1 named named 64 Mar 25 03:40 14 -> /var/named/data/named.run
lrwx------. 1 named named 64 Mar 25 03:40 2 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 20 -> socket:[23128]
lrwx------. 1 named named 64 Mar 25 03:40 21 -> socket:[23142]
lrwx------. 1 named named 64 Mar 25 03:40 22 -> socket:[23144]
lrwx------. 1 named named 64 Mar 25 03:40 23 -> socket:[23146]
lrwx------. 1 named named 64 Mar 25 03:40 24 -> socket:[23149]
lrwx------. 1 named named 64 Mar 25 03:40 25 -> socket:[23150]
lrwx------. 1 named named 64 Mar 25 03:40 3 -> socket:[23104]
lr-x------. 1 named named 64 Mar 25 03:40 4 -> /var/lib/sss/mc/initgroups
lrwx------. 1 named named 64 Mar 25 03:40 5 -> socket:[23109]
lrwx------. 1 named named 64 Mar 25 03:40 512 -> socket:[23140]
lrwx------. 1 named named 64 Mar 25 03:40 513 -> socket:[23143]
lrwx------. 1 named named 64 Mar 25 03:40 514 -> socket:[23145]
lrwx------. 1 named named 64 Mar 25 03:40 6 -> /dev/null
lr-x------. 1 named named 64 Mar 25 03:40 7 -> pipe:[23118]
l-wx------. 1 named named 64 Mar 25 03:40 9 -> pipe:[23118]
lsof -p 1439|grep socket
named 1439 named 3u unix 0xffff996433a0e600 0t0 23104 socket
named 1439 named 5u unix 0xffff996433a0ea40 0t0 23109 socket

why in lsof i see less soclet that in ls -l /proc/?

Last edited by linuly; 03-25-2021 at 03:01 AM.
 
Old 03-25-2021, 03:03 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
why not?
An so is only opened if really required.
 
Old 03-25-2021, 04:40 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,296

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The only use case I find profitable is
Code:
lss <program> |grep found
And if that throws up anything, you have issues. Otherwise, why bother? I imagine purely internal factors of how the program was structured/written affect what use it made of dependencies. If the programmer is a game, all libraries will be wanted now to avoid delays. If the programmer tries to keep the overhead low, stuff can be called as required only and closed afterwards.
 
Old 03-25-2021, 05:25 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by linuly View Post
Code:
 ls -l /proc/1439/fd
total 0
lrwx------. 1 named named 64 Mar 25 03:40 0 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 1 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 10 -> anon_inode:[eventpoll]
lr-x------. 1 named named 64 Mar 25 03:40 11 -> /usr/share/GeoIP/GeoIP-initial.dat
lr-x------. 1 named named 64 Mar 25 03:40 12 -> /usr/share/GeoIP/GeoIPv6-initial.dat
lr-x------. 1 named named 64 Mar 25 03:40 13 -> /dev/random
l-wx------. 1 named named 64 Mar 25 03:40 14 -> /var/named/data/named.run
lrwx------. 1 named named 64 Mar 25 03:40 2 -> /dev/null
lrwx------. 1 named named 64 Mar 25 03:40 20 -> socket:[23128]
lrwx------. 1 named named 64 Mar 25 03:40 21 -> socket:[23142]
lrwx------. 1 named named 64 Mar 25 03:40 22 -> socket:[23144]
lrwx------. 1 named named 64 Mar 25 03:40 23 -> socket:[23146]
lrwx------. 1 named named 64 Mar 25 03:40 24 -> socket:[23149]
lrwx------. 1 named named 64 Mar 25 03:40 25 -> socket:[23150]
lrwx------. 1 named named 64 Mar 25 03:40 3 -> socket:[23104]
lr-x------. 1 named named 64 Mar 25 03:40 4 -> /var/lib/sss/mc/initgroups
lrwx------. 1 named named 64 Mar 25 03:40 5 -> socket:[23109]
lrwx------. 1 named named 64 Mar 25 03:40 512 -> socket:[23140]
lrwx------. 1 named named 64 Mar 25 03:40 513 -> socket:[23143]
lrwx------. 1 named named 64 Mar 25 03:40 514 -> socket:[23145]
lrwx------. 1 named named 64 Mar 25 03:40 6 -> /dev/null
lr-x------. 1 named named 64 Mar 25 03:40 7 -> pipe:[23118]
l-wx------. 1 named named 64 Mar 25 03:40 9 -> pipe:[23118]
lsof -p 1439|grep socket
named 1439 named 3u unix 0xffff996433a0e600 0t0 23104 socket
named 1439 named 5u unix 0xffff996433a0ea40 0t0 23109 socket

why in lsof i see less soclet that in ls -l /proc/?
I would check what lsof says about file descriptors 20..25.
 
Old 03-25-2021, 05:32 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
again, a misleading title. How is ldd related to those sockets?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 5.10 -> 6.06: diversion of /usr/bin/ldd to /usr/bin/ldd.amd64 by ia32-libs HellSpawn Linux - Software 2 06-04-2006 09:18 PM
Cannot compile LDD example codes... okeyla Linux - Hardware 0 05-03-2005 08:30 PM
about ldd -d jingle_mj Programming 4 09-10-2004 06:25 AM
about ldd -d jingle_mj Linux - General 2 08-25-2004 06:30 AM
ldd simon Linux - General 1 08-02-2001 06:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration