Apr 4 2002


                     LINUX NEWS
     Resources & Links From www.CramSession.com
              Thursday, April 4, 2002


TABLE OF CONTENTS

1) Sean’s Notes

2) Linux News

Is It The Way Out?
We Have The Way In
Crossover to Linux
Mandrake 8.2: Great Software Distributed Poorly

3) Linux Resources

RHCE Study Site
HTTP Benchmarking
Help For DOS Users
Telephony Software for Linux
Network Analysis with Open Source Tools

4) App o’ the Week

~~~~~~~~~~~~~~~~~~~~~~ ADVERTISEMENT ~~~~~~~~~~~~~~~~~~~~~~~

Get your certification now. Pay later! If you want to learn more about Intense School’s No money down and No payments for one year financing, go to our website or call toll free 1-800-330-1446 to speak to an Intense School Specialist.

http://ad.brainbuzz.com/?RC06&AIQ06

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For information on how to advertise in this newsletter please contact mailto:adsales@CramSession.com or visit http://cramsession.com/marketing/default.asp


1) Sean’s Notes

UNIX, by nature, makes extensive use of shared resources such as code. The procedures to copy a string, write something to the screen, or even compress a stream, are well known. Rather than force every programmer to reinvent the wheel for each program, an extensive system of libraries was introduced.

A UNIX library, much like its physical counterpart, is a repository for information. In the more familiar sense, a library houses books. In the UNIX sense, a library houses commonly used routines. In the real world, you can expect that almost every library you walk in to will have an encyclopedia, a dictionary, and likely a subscription to a national paper. One library may carry all the latest scientific journals, while having few paperbacks.

Likewise, in UNIX we can look at any system and expect that certain things will be there, such as string routines, math routines, and directory services. Most systems will carry more than that, such as compression, X-Windows routines, and even routines useful only to proprietary software. Each package of routines is referred to as a library (which confuses the analogy somewhat), and appears as a file. Each library is a collection of object files, each of which implements one or more routines. Within the context of the object file (and thus the library), we refer to the routines as symbols.

Working backward, we have many routines, which are built as object files, and several object files with the same function are smashed together to form a library. When a programmer needs a certain routine, he invokes the library (in a procedure known as “linking”). In practice, the compiler software takes care of all of this, the programmer just has to call the routine.

Windows users thinking “This sounds a lot like a DLL” are right. While there are many differences, the intentions and functionality are similar.

Some of the libraries you can expect to find on any UNIX system are the C library (libc) and the math library (libm). The former, (pronounced lib-see) is where most of the good stuff happens, such as string manipulation, and the interface to system calls (working with files, etc). The “C” part of the library harks back to UNIX’s C-language beginnings, though other languages will, at some point, use libc calls in order to interact with the system. Though there are standards saying what must be in the system libraries, this even varies from flavor to flavor. One example would be Solaris, who implements most network calls in libnsl. Even within Linux there are multiple libc’s; several years ago we moved from the libc to a brand new glibc (gee-lib-see), mostly because of licensing and extra functionality.

With respect to the system, there are two ways we can make use of these libraries. The first is that every time a library function is needed in a program, the linker copies that part into the resulting binary. We call this “static linking”, and the binary is said to be in “a.out” format. Alternatively, one could make the assumption that the user of the program will have the same library, so all that is needed is a small stub routine saying “the instructions on how to do this are in libfoo.so”. This method is called “dynamic linking”, with the binary being in “ELF” format (Executable and Linking Format).

In general, static libraries have an “.a” extension, while dynamic libraries have some variant on “.so”. When a package comes in two parts, such as “foo” and “foo-devel”, the “foo” package usually has the shared library, and the “foo-devel” package will have a static library, and “header files” which help the programmer to use it. Some -devel packages include a modified shared library with extra information to help with debugging.

Statically linked binaries are nice in that if you use some esoteric libraries, the binary will still run on other people’s systems because everything is built right into it. However, I’ve got over 1,800 files in /usr/bin alone, the disk space used will start to get to be a pain. Furthermore, if we want to even think about sharing memory between libraries, we’re going to have to use the dynamic method.

Dynamic linking isn’t all peaches and cream, though. We’ve first got to make sure the user has a copy of the library we need. This means that he has to have the appropriate version, and the system has to know where to find it. All of this has to take place behind the scenes, while the program is loading.

Most of the dirty work is handled by “ld.so” (implemented in Linux as /lib/ld-linux.so). The “.so” extension should tip you off that it, too, is a shared object. ld.so is responsible for bringing together the binary, and all associated libraries at run time. To do this, it maintains a list of all the shared libraries on the system (in /etc/ld.so.cache). It builds this by searching all the directories specified in /etc/ld.so.conf.

If you see something like:

error while loading shared libraries: libgpm.so.1: cannot open shared object file: No such file or directory

That’s ld.so saying that it can’t find a library, in this case, libgpm.so. In many cases, you’ve got the library (find / -name libgpm.so.1 will find it), and it’s just that ld.so can’t find it. To add /usr/local/lib to ld.so’s search path, add /usr/local/lib to /etc/ld.so.conf, and run “ldconfig” to rebuild the cache. If the binary doesn’t show up, then you may not have it installed, or you may have the wrong version.

If you’re interested in seeing what shared libraries a binary uses, that’s what the “ldd” command is for:

ldd /usr/bin/vim

libncurses.so.5 => /usr/lib/libncurses.so.5 (0x4002b000)
libgpm.so.1 => /usr/lib/libgpm.so.1 (0x4006c000)
libdl.so.2 => /lib/libdl.so.2 (0x40072000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x40076000)
libpthread.so.0 => /lib/libpthread.so.0 (0x400a4000)
libm.so.6 => /lib/libm.so.6 (0x400bb000)
libc.so.6 => /lib/libc.so.6 (0x400dd000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Here we see that vim uses many libraries:

ncurses - advanced screen manipulation gpm - mouse interaction dl - other dynamic linking features crypt - encryption pthread - threads m - math routines c - the C library

the last is the hard coded reference to ld-linux.so (ld.so, really), which brings it all together.

ldd is also handy if you have multiple copies of the same shared library on your system, it will tell you which version is being loaded in.

That’s libraries in a nutshell. It leaves us in a good position to look further in to software dependencies, and to get more in tune with how the system works.

Long live the Penguin,

Sean mailto:swalberg@cramsession.com


2) Linux News


Is It The Way Out?

Microsoft and Unisys partnered to build a campaign that attacks UNIX. The web site, wehavethewayout.com, ran on (of all things) FreeBSD and Apache. Didn’t take long for people to pick up on it, the site was quickly converted to IIS 5, and hasn’t worked since (as of the writing of this article). Maybe they should have hired the “expensive UNIX people” to do the job for them; it would have saved some face.

http://news.com.com/2100-1001-874132.html


We Have The Way In

Microsoft can run the FUD (Fear, Uncertainty, Doubt) machine all they want, but never let it be said that geeks aren’t equally clever. Soon after the release of the anti-UNIX site, a pro-UNIX site cropped up.

http://www.wehavethewayin.com/


Crossover to Linux

Earlier I wrote that CodeWeavers have released a WINE-based product that lets you run Windows plug-ins like Media Player under Linux. Their latest news is that an expanded version will let you run Internet Explorer and Office! There are mixed reviews, as not everything is working 100%, but on the whole, this is a huge step forward.

http://www.linuxplanet.com/linuxplanet/reviews/4126/1/


Mandrake 8.2: Great Software Distributed Poorly

Mandrake 8.2 was released a while ago, but according to this review, only as a download. Bad news for Mandrake, as this could result in many lost sales. The good news is that 8.2 has a wealth of new features, and the hardware detection was exceptional.

http://newsforge.com/newsforge/02/04/03/1450240.shtml?tid#


3) Linux Resources


RHCE Study Site

Looking for information on the RHCE exam, practice questions, and notes? RHCE2B.COM seems to have it all. Several interviews with authors and people who have taken the exam give some insight into the prestigious Red Hat Certified Engineer program.

http://www.rhce2b.com/


HTTP Benchmarking

Benchmarking isn’t just for the marketroids. Properly done, you can use benchmarks to figure out capacity, and how your server will fare under a heavy load. It can also be used to verify that any tuning you have performed improves performance.

http://www.unixreview.com/documents/s35/urm0105q/0105q.htm


Help For DOS Users

If you’re familiar with the DOS command line, then this handy chart will help you to map the commands that you’re used to into their UNIX equivalents.

http://octoped.net/linux/lx-translate.html


Telephony Software for Linux

UNIX has found itself as the basis for some PBXs, so it should be no surprise that Linux has been adapted for telephony usage. Voice Over IP is one application, but so are SMS gateways and even PBXs. This article gives an overview of the various options out there.

http://freshmeat.net/articles/view/430/


Network Analysis with Open Source Tools

This is a practical step-by-step guide showing how to use Dsniff, MRTG, IP Flow Meter, Tcpdump, NTOP, Ngrep, and others. It also provides a discussion of how and why we should monitor network traffic.

http://www.linuxsecurity.com/feature_stories/dsniff/t1.html


4) App o’ the Week

After having problems with my DSL connection and PPPoE, I found this interesting little package for smaller DSL providers. It’s a Linux distribution that is designed specifically to terminate PPPoE sessions for providers. It can do 500 connections on a regular desktop, and even clusters up to 50 servers together for extra scalability and redundancy.

http://www.roaringpenguin.com/servpoet/


(C) 2002 BrainBuzz.com, Inc. All Rights Reserved.


     This message is from CramSession.com.

You are currently subscribed to the Hottest Linux News and Resources as: sean@ertw.com

To un-subscribe from this newsletter by e-mail: send a blank email message to: mailto:leave-linuxnews-3825955Y@list.cramsession.com


To Subscribe to this newsletter by e-mail: send a blank email message to:

mailto:join-linuxnews@list.cramsession.com