old-www/LDP/LG/issue09/binstats.html

83 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>Binstats: An Invaluable Shell Script</title>
</head>
<H4>&quot;Linux Gazette...<I>making Linux just a little more fun!</I>
&quot;</H4>
<HR>
<center><h1>Binstats: Finding Unusable Binaries</h1></center>
<center><h4>by Larry Ayers <layers@vax2.rain.gen.mo.us></h4></center>
<center>Copyright (c) 1996</center><BR>
<center> <H5>Published in Issue 9 of the Linux Gazette</H5></center>
<HR>
Like many other Linux users, I've strayed from the path of my originally
installed distribution (Slackware 3.00) and have updated quite a large
percentage of the packages and libraries. This can lead to problems; these
might come my attention when starting up a long-neglected executable only to
receive a message indicating that an essential library is missing, or that a
library has an incompatible executable format.<p>
Of course, you could spend a couple of hours every month or so and run ldd on
each and every executable on your system, writing down the results for every
one which has errors. This could become tedious, I imagine.<p>
<a href="Mailto: Peter.Chang@nottingham.ac.uk">Peter Chang</a> is evidently a
whiz at cobbling together shell scripts which use various Unix utilities
chained and piped one to another. <b>Binstats</b> is one of his, and it is
truly an ingenious contrivance. You start it up (after editing it so that it
knows where all of your /bin directories are), the hard disc grinds away for a
minute or three, and this little script presents you with a list of all the
poor orphaned programs which can't run due to a lack of shared libs. It also
lists how many of each type of executable (ELF, QMagic, statically linked,
etc.) you have, and which shared libs you have which aren't needed by any of
your executables.<p>
What really blew my mind was seeing a long list of duplicated executable
names, an unexpected result of many upgrades. This can be a result of this
imaginary scenario: Joe has been maintaining Package X for several years and
is weary of the constant email. He gratefully transfers the maintenance of
Package X to an eager, energetic young programmer, Ed. Ed is appalled to
find an installation procedure which doesn't follow the Linux Filesystem
Standard, and immediately changes the default installation directory from /bin
to /usr/local/bin. Yours truly logs in at sunsite.unc.edu, finds a new
version of Package X, installs it, and is happy to see the new functionality.
Unfortunately the old Package X executable is living out the remainder of its
days, unknown to all, in /bin. Then Binstats does its work and the old X
binary and all its hoary cohorts are brought to light.<p>
All of the functions of Binstats can be done "by hand", of course. The beauty
of this shell program is the combination of tasks into one, with the results
logged to a text file. Then you can see at a glance several system
administration jobs which should be taken care of.<p>
Binstats is only four and one-half kb. archived in tgz format. A copy of the
latest version is available at <a
href="http://www.ccc.nottingham.ac.uk/~etzpc/binstats.html">this UK site</a>,
as well as in <a href="ftp://sunsite.unc.edu/pub/Linux/utils/scripts/">this
sunsite directory</a>. It's well worth the short download time, even if you
only run it once.
<hr>
<center><address><a href="http://vax2.rain.gen.mo.us/~layers/">Larry Ayers&lt;layers@vax2.rain.gen.mo.us&gt;</a></address></center><br>
<hr>
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="lg_bytes09.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="newsserver.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<hr>
</body> </html>