Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Perl, sort of Unix/system archaeology question

by Miss Brain (Acolyte)
on May 05, 2005 at 13:54 UTC ( [id://454364]=perlquestion: print w/replies, xml ) Need Help??

Miss Brain has asked for the wisdom of the Perl Monks concerning the following question:

What would you say the best way is to catalogue all the Perl and other applications running on a Unix (RH 9) system? I'm going through the Unix directory structure for standard install locations.

I just received a web server with unknown apps running on it. It includes a mix of open-source and proprietary apps, some installed databases, language installations like Java and Perl... and I've been asked to catalogue everything worthwhile on the server. How do I ensure I'm not missing anything?

thanks in advance -
Miss Brain

  • Comment on Perl, sort of Unix/system archaeology question

Replies are listed 'Best First'.
Re: Perl, sort of Unix/system archaeology question
by amw1 (Friar) on May 05, 2005 at 14:25 UTC
    Not specifically perl related but some of this may point you in the right direction.
    1) Run nmap against the box, find out what ports have something listening
    2) run lsof -i to find out what programs are bound to those ports
    3) take a look at the xinetd.conf stuff, find out what may be started when a port is hit
    4) take a look at /etc/rc.# and find out what is getting started. Figure out what the # is by looking at inittab
    5) take a good backup of the box, make sure it is a good backup of the box. Check the backup again. (including sane database backups) Then blow the box away, re-install it, and wait for people to complain about missing things. :)
    6) Take a look at the site_perl directories to find what perl modules have been loaded on to the system.

    With all of that, you may still miss stuff. But you should be able to catch the important things.

Re: Perl, sort of Unix/system archaeology question
by samizdat (Vicar) on May 05, 2005 at 15:10 UTC
    Hmmm... 'Running', or 'Installed'?

    If all you need is running apps, check the rc files and check the crontab(s) (as well as the services and ports as the other poster mentioned). On BSD, there's also a startup directory /usr/local/etc/rc.d where any script that's executable gets fired off.

    If you're looking for what's installed, I'd also do a systemwide sweep of everything in /usr except /usr/src, and look at the magic numbers (first 2 bytes) and shebang lines. Once you have that list, you can identify what's code. Come to think of it, I suppose you could do a first pass look at anything that has its x permission set.
Re: Perl, sort of Unix/system archaeology question
by zentara (Cardinal) on May 05, 2005 at 15:38 UTC
    It's often an annoyance, but if you hit Esc twice (real fast) in an xterm, you will get a list of everything in the $PATH. You can use it as a basic list of everything.

    You probably could setup an lwp script, to search wikipedia for each entry and print out a summary of what everything does. Check out wikipedia search script


    I'm not really a human, but I play one on earth. flash japh
      if you hit Esc twice (real fast) in an xterm, you will get a list of everything in the $PATH

      This is shell specific so cannot be expected to work everywhere.

Re: Perl, sort of Unix/system archaeology question
by jpeg (Chaplain) on May 06, 2005 at 01:59 UTC
    In addition to the excellent answers already given, rpm gives you some pretty good info:

    for i in `rpm -qa`; do rpm -qi ${i}; done
    Custom apps are often stored in /usr/local/bin, sometimes in /opt/(package), and not very often in /usr(package). And there's the odd package that wants a user created so its software can live under /home. :)

    Good luck.

    --
    jpg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://454364]
Approved by moot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2025-07-09 07:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.