Olivier
2012-Jan-16 10:14 UTC
[asterisk-users] How to check currently used libraries from command line ?
Hi, I've recently upgraded a system from 1.8 to asterisk 10 and also updated spandsp while doing so. I wondered what is the safest and easiest way to check from command line which libraries a running Asterisk system is currently using (just like "dahdi show version", for instance). Though I'm currently asking this for spandsp, this question is on a more general plan (for example, which ssl library am I currently using ?). Suggestions ? Regards
Anton Kvashenkin
2012-Jan-16 10:18 UTC
[asterisk-users] How to check currently used libraries from command line ?
ldd 2012/1/16 Olivier <oza_4h07 at yahoo.fr>> Hi, > > I've recently upgraded a system from 1.8 to asterisk 10 and also > updated spandsp while doing so. > I wondered what is the safest and easiest way to check from command > line which libraries a running Asterisk system is currently using > (just like "dahdi show version", for instance). > > Though I'm currently asking this for spandsp, this question is on a > more general plan (for example, which ssl library am I currently using > ?). > > Suggestions ? > > Regards > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120116/76b2dc6e/attachment-0001.htm>
Ruben Rögels
2012-Jan-16 10:20 UTC
[asterisk-users] How to check currently used libraries from command line ?
Hi Olivier, I suppose you give "strace" a try. It's a powerful debugging utility, you should be able to find everything you are looking for. best regards, Ruben Am 16.01.2012 11:14, schrieb Olivier:> Hi, > > I've recently upgraded a system from 1.8 to asterisk 10 and also > updated spandsp while doing so. > I wondered what is the safest and easiest way to check from command > line which libraries a running Asterisk system is currently using > (just like "dahdi show version", for instance). > > Though I'm currently asking this for spandsp, this question is on a > more general plan (for example, which ssl library am I currently using > ?). > > Suggestions ? > > Regards > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
A J Stiles
2012-Jan-16 10:43 UTC
[asterisk-users] How to check currently used libraries from command line ?
On Monday 16 January 2012, Olivier wrote:> Hi, > > I've recently upgraded a system from 1.8 to asterisk 10 and also > updated spandsp while doing so. > I wondered what is the safest and easiest way to check from command > line which libraries a running Asterisk system is currently using > (just like "dahdi show version", for instance). > > Though I'm currently asking this for spandsp, this question is on a > more general plan (for example, which ssl library am I currently using > ?).To find out which libraries a particular binary executable program is linked against, you just need to do $ ldd /path/to/executable You can find the actual path to an executable by typing $ which foo Replace foo by the name of the executable about which you want information, obviously. Now, because we usually want the computer to do as much of the hard work for us as possible, we can use the $(command) operator -- which treats whatever is between the brackets as a command, runs it and substitutes its output into the command which it was part of -- to combine these two commands into one: $ ldd $(which foo) i.e. it will run "which foo", and then do "ldd" on whatever output "which foo" returned. Trivial example below: $ ldd $(which ls) linux-vdso.so.1 => (0x00007fffa7974000) libselinux.so.1 => /lib/libselinux.so.1 (0x00007fdc03188000) librt.so.1 => /lib/librt.so.1 (0x00007fdc02f80000) libacl.so.1 => /lib/libacl.so.1 (0x00007fdc02d78000) libc.so.6 => /lib/libc.so.6 (0x00007fdc02a17000) libdl.so.2 => /lib/libdl.so.2 (0x00007fdc02813000) /lib64/ld-linux-x86-64.so.2 (0x00007fdc033ce000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fdc025f6000) libattr.so.1 => /lib/libattr.so.1 (0x00007fdc023f2000) Hmm, that's a whole lot of libraries just to get a directory listing! Not surprisingly, busybox gets away with rather less: $ ldd $(which busybox) linux-vdso.so.1 => (0x00007fff2b7ff000) libm.so.6 => /lib/libm.so.6 (0x00007f04a8217000) libc.so.6 => /lib/libc.so.6 (0x00007f04a7eb6000) /lib64/ld-linux-x86-64.so.2 (0x00007f04a84c1000) Note1: Here we see 16 hex digits after each library name, indicating a 64-bit system. On a 32-bit system, we would see only 8 hex digits after each library name. Note2: Programs that sometimes or always crash, may be missing a library. If so, this will be obvious when you run ldd. -- AJS Answers come *after* questions.
Tzafrir Cohen
2012-Jan-16 12:35 UTC
[asterisk-users] How to check currently used libraries from command line ?
On Mon, Jan 16, 2012 at 11:14:48AM +0100, Olivier wrote:> Hi, > > I've recently upgraded a system from 1.8 to asterisk 10 and also > updated spandsp while doing so. > I wondered what is the safest and easiest way to check from command > line which libraries a running Asterisk system is currently using > (just like "dahdi show version", for instance). > > Though I'm currently asking this for spandsp, this question is on a > more general plan (for example, which ssl library am I currently using > ?).To see the actual memory map of the process: pmap $PID_OF_ASTERISK Code is mapped from files, and thus you'll see the original files. You'll probably need to remove duplicates and such. Note that ldd of /usr/sbin/asterisk will not give you libraries of the various modules. For that you'll have to run ldd on the specific modules. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir