| 1 |
Proc::ProcessTable |
| 2 |
|
| 3 |
Please use rt.cpan.org to submit bugs and patches. |
| 4 |
|
| 5 |
MAINTENANCE STATUS |
| 6 |
================== |
| 7 |
This module is now being lightly "maintained" by Jonathan Swartz <[email protected]>. I |
| 8 |
have nearly zero knowledge of the implementation within but wanted to rescue the |
| 9 |
distribution from abandonment and try to get critical bug fixes out. This will need to be |
| 10 |
a community effort. |
| 11 |
|
| 12 |
The source is in github - |
| 13 |
|
| 14 |
https://github.com/jwbargsten/perl-proc-processtable |
| 15 |
|
| 16 |
Commit bits will be generously granted, send me your github id. |
| 17 |
|
| 18 |
STATUS |
| 19 |
====== |
| 20 |
This is BETA software; it seems to work, but use at your own risk :) |
| 21 |
|
| 22 |
Currently works on darwin, nonstop-ux, Windows (both native MSWin32 and Cygwin), linux, |
| 23 |
solaris, aix, hpux, freebsd, irix, dec_osf, bsdi, netbsd, unixware 7.x, |
| 24 |
SunOS and openbsd. Please see the "README.osname" files for details on |
| 25 |
individual os implementations. Please see the file PORTING if you are |
| 26 |
interested in making it work on something else. Please see the file |
| 27 |
TODO for a list of issues that need to be addressed (and send me |
| 28 |
patches!). |
| 29 |
|
| 30 |
Please note that the Windows port is derived from Cygwin code and is therefore covered |
| 31 |
by the Cygwin license (http://cygwin.com/licensing.html). |
| 32 |
|
| 33 |
Multithread support is now available for Solaris; please see |
| 34 |
README.solaris for info. It may work under other OS's as well; please |
| 35 |
let me know if it does. |
| 36 |
|
| 37 |
Comments, bug reports, patches and especially ports are greatly |
| 38 |
appreciated. If you want to submit a patch, *please* use standard |
| 39 |
context-diff format; if you're submitting a port, a tarball of the new |
| 40 |
files is great. |
| 41 |
|
| 42 |
DESCRIPTION |
| 43 |
=========== |
| 44 |
This module is a first crack at providing a consistent interface to |
| 45 |
Unix (and maybe other multitasking OS's) process table information. |
| 46 |
The impetus for this came about with my frustration at having to parse |
| 47 |
the output of various systems' ps commands to check whether specific |
| 48 |
processes were running on different boxes at a larged mixed Unix site. |
| 49 |
The output format of ps was different on each OS, and sometimes |
| 50 |
changed with each new release of an OS. Also, running a ps subprocess |
| 51 |
from within a perl or shell script and parsing the output was not a |
| 52 |
very efficient or aesthetic way to do things. |
| 53 |
|
| 54 |
With this module, you can do things like this: |
| 55 |
|
| 56 |
# kill memory pigs |
| 57 |
use Proc::ProcessTable; |
| 58 |
|
| 59 |
my $t = Proc::ProcessTable->new; |
| 60 |
foreach my $p ( @{$t->table} ) { |
| 61 |
if( $p->pctmem > 95 ){ |
| 62 |
$p->kill(9); |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
There is another short example in the file "example.pl" in the |
| 67 |
distribution. For a more elaborate example (in German), see |
| 68 |
<http://www.linux-magazin.de/ausgabe.1999.02/Proc/proc.html>. |
| 69 |
<shameless plug> If you can't read German, try my other module, |
| 70 |
WWW::Babelfish!</shameless plug> |
| 71 |
|
| 72 |
There are also two contributed modules: a module called Proc::Killall |
| 73 |
contributed by Aaron Sherman to kill all processes whose command-lines |
| 74 |
match a given pattern, and a module called Proc::Killfam by Stephen |
| 75 |
Lidie to kill a list of processes and their children. These modules |
| 76 |
are installed along with Proc::ProcessTable. Pod documentation is |
| 77 |
included in both of them. |
| 78 |
|
| 79 |
|
| 80 |
INSTALLATION |
| 81 |
============ |
| 82 |
This module needs the File::Find and Storable modules in order to |
| 83 |
work. File::Find is generally included with perl distributions; |
| 84 |
Storable is available from CPAN. |
| 85 |
|
| 86 |
After unpacking the tar file, do: |
| 87 |
|
| 88 |
perl Makefile.PL |
| 89 |
make |
| 90 |
make test |
| 91 |
make install |
| 92 |
|
| 93 |
There is embedded POD documentation in ProcessTable.pm and |
| 94 |
Process/Process.pm. |
| 95 |
|
| 96 |
ACKNOWLEDGEMENTS |
| 97 |
================ |
| 98 |
Thanks to the many people who have sent in ports and patches. Without |
| 99 |
them this module would be impossible to support on so many platforms. |
| 100 |
Patches are noted in the Changes file. |
| 101 |
|
| 102 |
David Paquet <[email protected]> AIX port |
| 103 |
Mike Romberg <[email protected]> HPUX port |
| 104 |
Slaven Rezic <[email protected]> FreeBSD port |
| 105 |
W. Phillip Moore <[email protected]> IRIX port |
| 106 |
Peter ? <[email protected]> IRIX version patch |
| 107 |
Bernhard Schmalhofer <[email protected]> dec_osf port |
| 108 |
Sean Eskins <[email protected]> bsdi port |
| 109 |
Peter Reich <[email protected]> netbsd port |
| 110 |
Aaron Sherman <[email protected]> Proc::Killall module |
| 111 |
Steve Lidie <[email protected]> Killfam.pm module |
| 112 |
Martin Lucina <[email protected]> Unixware 7.x port |
| 113 |
Shawn Clifford <[email protected]> SunOS port |
| 114 |
J Robert Ray <[email protected]> Windows (Cygwin) port. |
| 115 |
Tom Wyant <[email protected]> Darwin port. |
| 116 |
Mike Steinert <[email protected]> |
| 117 |
Nonstop-UX port. |
| 118 |
<[email protected]> Openbsd port. |
| 119 |
|
| 120 |
Please note that Bernard Schmalhofer is no longer able to provide |
| 121 |
support for the dec_osf port. |
| 122 |
|
| 123 |
COPYRIGHT |
| 124 |
========= |
| 125 |
Copyright (c) 1998-2008 Daniel J. Urist. All rights reserved. |
| 126 |
This package is free software; you can redistribute it and/or modify |
| 127 |
it under the same terms as Perl itself. |
| 128 |
|
| 129 |
-- |
| 130 |
Daniel J. Urist |
| 131 |
[email protected] |