Imported Upstream version 1.07

This commit is contained in:
Jan Wagner 2013-11-06 09:53:33 +01:00
parent 87e0216b00
commit a8f50c0a7c
53 changed files with 15751 additions and 0 deletions

3
AUTHORS Normal file
View file

@ -0,0 +1,3 @@
Rocky Bernstein <rocky@gnu.org>
# $Id: AUTHORS,v 1.3 2008/12/17 20:08:43 rockyb Exp $

340
COPYING Normal file
View file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

851
ChangeLog Normal file
View file

@ -0,0 +1,851 @@
##
## autogenerated ChangeLog -- don't edit
##
2008-12-25 Thursday 17:01 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, samples/root-procs.ini: Add sample code using
perl-action.
2008-12-25 Thursday 16:42 Rocky Bernstein <rocky@cpan.org>
* configure.ac, tests/paction.cnf: More Darwin9 fixes: tty can be
many token so put at end of parsing.
2008-12-25 Thursday 16:39 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, NEWS, configure.ac: Get ready for 1.07 release
2008-12-23 Tuesday 11:09 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Typo: svz -> vsz. Thanks to Oliver Guerrier for
pointing out.
2008-12-18 Thursday 01:07 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Bug in duplicating log
2008-12-17 Wednesday 20:08 Rocky Bernstein <rocky@cpan.org>
* ANNOUNCE, AUTHORS, configure.ac: test cygwin and NetBSD and
update contact info
2008-12-17 Wednesday 19:28 Rocky Bernstein <rocky@cpan.org>
* post-configure.in: Tolerate older Perl's enough to warn that we
can't use them.
2008-12-17 Wednesday 18:31 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Linux newline nuke fixes along the lines of the
Darwin code
2008-12-17 Wednesday 17:06 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in: Better about dealing with
unwritable log file
2008-12-17 Wednesday 16:31 Rocky Bernstein <rocky@cpan.org>
* configure.ac: In 1.07 now
2008-12-17 Wednesday 16:27 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Changes for Darwin9
2006-11-17 Friday 14:02 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in, home-page/index.html: Small typos.
2006-09-21 Thursday 23:07 Rocky Bernstein <rocky@cpan.org>
* home-page/index.html: Correct for new sf link
2006-03-11 Saturday 03:16 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: More doc changes
2006-03-10 Friday 19:33 Rocky Bernstein <rocky@cpan.org>
* NEWS: Last change before release
2006-03-10 Friday 19:07 Rocky Bernstein <rocky@cpan.org>
* configure.ac, post-configure.in, ps-watcher.in.in,
tests/basic.t.in: Deal with time on netbsdelf and regression
tests. basic.t.in: generalize time handling - not just cygwin.
post-configure.in configure.ac: clean up a little.
2006-03-10 Friday 13:12 Rocky Bernstein <rocky@cpan.org>
* tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Run
ps-watcher in tests with configured Perl location.
2006-03-10 Friday 12:47 Rocky Bernstein <rocky@cpan.org>
* tests/: full.cnf, full.t.in: Add a test and adjust for cygwin.
2006-03-10 Friday 12:26 Rocky Bernstein <rocky@cpan.org>
* configure.ac, post-configure.in, ps-watcher.in.in,
tests/basic.t.in: Changes to make this work on more
architectures. configure.ac, post-configure.in: another attempt
to get invocation work eveywhere basic.t.in: test for cputime;
forgot !
2006-03-10 Friday 04:51 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Darwin 8 is okay
2006-03-10 Friday 04:50 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Bug in running right Perl in post-configure
2006-03-10 Friday 03:49 Rocky Bernstein <rocky@cpan.org>
* configure.ac, post-configure.in: Use PERL value specified more.
2006-03-10 Friday 03:39 Rocky Bernstein <rocky@cpan.org>
* NEWS, configure.ac: Add configure option to specify Perl location
2006-03-10 Friday 03:24 Rocky Bernstein <rocky@cpan.org>
* tests/args.t.in: typo: it's ok not okay.
2006-03-10 Friday 03:21 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, tests/args.t.in,
tests/basic.t.in, tests/full.t.in, tests/paction.t: Add minimal
cygwin support
2006-03-09 Thursday 17:37 Rocky Bernstein <rocky@cpan.org>
* configure.ac, post-configure.in, tests/01.pod.t.in,
tests/Makefile.am: 01.pod.t.in: add POD testing routine
configure.ac: do chmod +x on perl-substituted files.
2006-03-09 Thursday 16:46 Rocky Bernstein <rocky@cpan.org>
* NEWS, ps-watcher.in.in: Document security better.
2006-03-08 Wednesday 22:52 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, home-page/index.html: Get ready
for 1.06 release.
2006-03-08 Wednesday 22:24 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Correction in getting signal name.
2006-03-08 Wednesday 19:21 Rocky Bernstein <rocky@cpan.org>
* touch.pl: Reinstate since Makefile.am uses.
2006-03-08 Wednesday 19:15 Rocky Bernstein <rocky@cpan.org>
* AUTHORS, Makefile.am, cvs2cl_usermap, post-configure.in,
ps-watcher.in.in, touch.pl: ps-watcher.in.in: Wasn't terminating
properly. Thanks to David G. Humes for noticing and fixing.
Modernize code a little bit
*: rocky@panix.com -> rocky@cpan.org touch.pl: now handled inside
post-configure by Perl
2006-02-03 Friday 02:23 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: One more small typo.
2006-02-03 Friday 02:15 Rocky Bernstein <rocky@cpan.org>
* post-configure.in, ps-watcher.in.in, home-page/index.html: Mostly
small changes:
ps-watcher.in.in options are now stored in %opts. Some perlpod
grammar fixes.
post-configure.in: Suggest "make && make check" (and not with
semicolon)
home-page/index.html: Probably remove a W3C error.
2006-01-17 Tuesday 10:00 Rocky Bernstein <rocky@cpan.org>
* home-page/index.html: Make valid HTML as per W3C.
2005-10-12 Wednesday 01:14 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in, NEWS: Add BUGS section to manual to describe
common problems.
2005-09-12 Monday 17:03 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Now in 1.06cvs territory
2005-09-12 Monday 17:03 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Guard against uninitialized variables
2005-06-22 Wednesday 01:59 Rocky Bernstein <rocky@cpan.org>
* home-page/index.html: <Code> instead of <kbd>?
2005-06-22 Wednesday 01:57 Rocky Bernstein <rocky@cpan.org>
* home-page/index.html: Correct grammar courtesy of Sir Monitor
Lizard, Ph. Mad.
2005-05-17 Tuesday 22:00 Rocky Bernstein <rocky@cpan.org>
* NEWS: What's new.
2005-05-17 Tuesday 09:56 Rocky Bernstein <rocky@cpan.org>
* configure.ac: NetBSD works like FreeBSD
2005-05-17 Tuesday 09:52 Rocky Bernstein <rocky@cpan.org>
* COPYING, Makefile.am, NEWS, config.guess, config.sub,
configure.ac, missing, post-configure.in, docs/Makefile.am,
tests/Makefile.am: configure.ac: Darwin 7 is like Darwin5 & 6.
configure.ac, post-configure.in: check for at least perl 5.6
GPL address change.
2005-04-09 Saturday 18:06 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Like this a tad better.
2005-04-04 Monday 23:58 Rocky Bernstein <rocky@cpan.org>
* NEWS, ps-watcher.in.in: Note recent change.
2005-04-04 Monday 23:53 Rocky Bernstein <rocky@cpan.org>
* THANKS: Add thanks to Iñaki Sánchez.
2005-04-04 Monday 23:50 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in, tests/basic.cnf.in: Allow $ps_pat to be used in
action. Patch courtesy of Iñaki Sánchez. (i s a n c h e z at
unav dot es)
2004-09-11 Saturday 13:29 Rocky Bernstein <rocky@cpan.org>
* docs/.cvsignore: More pod2htm stuff.
2004-09-09 Thursday 10:58 Rocky Bernstein <rocky@cpan.org>
* NEWS, cvs2cl_header, cvs2cl_usermap: ChangeLog-creation
improvements.
2004-09-07 Tuesday 13:51 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, ps-watcher.in.in, docs/Makefile.am,
samples/port-watch.ini: Make distcheck works. Show how to use
$PROLOG to do a no-ps like thing such as watching a port (via
lsof).
2004-05-26 Wednesday 13:46 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Small change.
2004-05-26 Wednesday 13:42 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, configure.ac, ps-watcher.in.in, docs/Makefile.am:
ps-watcher.in.in: smallish changes - call closelog on
termination, add prototype for pod_this().
docs/Makefile.am: ignore errors in building manual/html pages
Makefile.am: target to create ChangeLog when building
distribution
configure.ac: now in version 1.05 now. Allow maintainer mode (to
create ChangeLog)
2004-02-15 Sunday 12:03 Rocky Bernstein <rocky@cpan.org>
* docs/Makefile.am: Set title to name without the .in.
2004-01-18 Sunday 12:20 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Update copyright.
2004-01-18 Sunday 11:49 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Improve documentation with respect to
perl-action.
2004-01-15 Thursday 03:23 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: perldoc fix.
2004-01-15 Thursday 03:02 Rocky Bernstein <rocky@cpan.org>
* tests/paction.t: Regression test for $PROLOG, $EPILOG and
perl-action.
2004-01-15 Thursday 03:00 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, tests/Makefile.am,
tests/paction.cnf: Add $PROLOG, $EPILOG and perl-action sections.
Allows one to accumulate information over all processes and take
action on that.
2004-01-10 Saturday 04:39 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Documentation enhancement, I think.
2003-11-22 Saturday 12:31 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: And another formatting change...
2003-11-22 Saturday 12:27 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: One more trivial typo....
2003-11-22 Saturday 12:26 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Documentation typo.
2003-11-22 Saturday 12:01 Rocky Bernstein <rocky@cpan.org>
* NEWS, configure.ac: Get ready for new (minor) release.
2003-11-21 Friday 02:36 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in, tests/basic.cnf.in, tests/basic.t.in: Add
first-trigger feature.
2003-09-11 Thursday 03:17 Rocky Bernstein <rocky@cpan.org>
* NEWS: Get ready for a release.
2003-09-10 Wednesday 07:30 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Fix example configuration as suggested in bug
#776229.
2003-09-05 Friday 00:23 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: More complicated trigger example suggested by
jason
2003-09-03 Wednesday 02:04 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Add troubleshooting section
2003-09-03 Wednesday 01:42 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in: Fixes for FreeBSD
2003-08-31 Sunday 21:22 Rocky Bernstein <rocky@cpan.org>
* tests/basic.cnf.in: perhaps some processes use so little CPU that
the elapsed time will round to zero. Deal with it.
2003-08-30 Saturday 20:49 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Update date.
2003-08-29 Friday 10:49 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Get ready for another release.
2003-08-29 Friday 10:48 Rocky Bernstein <rocky@cpan.org>
* tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Regression
tests need to deal with timestamped output.
2003-08-29 Friday 10:47 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Add syslog-like timestamp to logfile output.
Problems with getting ps-output now appears only on debug output.
2003-08-29 Friday 10:45 Rocky Bernstein <rocky@cpan.org>
* post-configure.in: Use -w (warning) on perl invocation
2003-08-13 Wednesday 02:33 Rocky Bernstein <rocky@cpan.org>
* configure.ac: PS_CAN_RETURN_MULTIPLE_LINES not set on AIX which
broke it.
2003-07-11 Friday 05:56 Rocky Bernstein <rocky@cpan.org>
* Makefile.am: Add sample files
2003-07-11 Friday 05:47 Rocky Bernstein <rocky@cpan.org>
* configure.ac: typo
2003-07-11 Friday 05:46 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Get ready for 1.0 release.
2003-07-11 Friday 05:43 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, tests/Makefile.am, tests/args.t.in,
tests/count.t.in, tests/full.t.in: Make "make distcheck" work.
2003-07-11 Friday 05:42 Rocky Bernstein <rocky@cpan.org>
* THANKS: Update as appropriate.
2003-07-10 Thursday 12:20 Rocky Bernstein <rocky@cpan.org>
* configure.ac, post-configure.in: A tad better for making "make
distcheck" work: Use $srcdir in post-configure and arrange for
srcdir to be passed in.
2003-07-10 Thursday 11:50 Rocky Bernstein <rocky@cpan.org>
* THANKS, TODO, config.cache, configure.ac, ps-watcher.in.in: Deal
with ps (e.g. Solaris's) which return more than one line for a
single pid.
2003-07-10 Thursday 11:42 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Stupid mistake - comments are # not /* */.
2003-05-19 Monday 16:33 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Accomodate darwin6
2003-05-19 Monday 16:33 Rocky Bernstein <rocky@cpan.org>
* tests/args.t.in: Add one test of --nosyslog
2003-05-19 Monday 15:58 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Add AIX support.
2003-05-16 Friday 00:12 Rocky Bernstein <rocky@cpan.org>
* README: IniConf is now called Config::IniFiles
2003-03-06 Thursday 05:57 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Failed full test. Need to add -x.
2003-03-06 Thursday 05:48 Rocky Bernstein <rocky@cpan.org>
* tests/full.cnf: Don't assume first is pid 1!
2003-03-06 Thursday 05:37 Rocky Bernstein <rocky@cpan.org>
* configure.ac, tests/Makefile.am, tests/.cvsignore,
tests/full.cnf, tests/full.t.in: Add test that we can trigger on
watching processes other than the ones under our account.
2003-03-06 Thursday 03:54 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, NEWS, config.guess, configure.ac, docs/Makefile.am,
tests/Makefile.am: Changes for Mac OS/X
2003-03-04 Tuesday 18:01 Rocky Bernstein <rocky@cpan.org>
* aclocal.m4, docs/Makefile.am, tests/Makefile.in: Add more
automake conversion idioms
2003-03-04 Tuesday 14:14 Rocky Bernstein <rocky@cpan.org>
* autogen.sh: Omitted running aclocal, autoconf, automake...
2003-03-04 Tuesday 14:08 Rocky Bernstein <rocky@cpan.org>
* docs/: Makefile.am, Makefile.in: More automake conversion pains.
2003-03-04 Tuesday 14:05 Rocky Bernstein <rocky@cpan.org>
* .cvsignore, MANIFEST: MANIFEST: not used in automake
2003-03-04 Tuesday 14:03 Rocky Bernstein <rocky@cpan.org>
* NEWS, autogen.sh: autogen.sh: useful for CVS NEWS: what's been
happening?
2003-03-04 Tuesday 13:59 Rocky Bernstein <rocky@cpan.org>
* Makefile.am, Makefile.in: More automake conversion work.
Makefile.am: forgot to add Makefile.PL. Makefile.in: superceded
by Makfile.am
2003-03-04 Tuesday 13:55 Rocky Bernstein <rocky@cpan.org>
* AUTHORS, Makefile.am, Makefile.in, NEWS, aclocal.m4, version,
docs/Makefile.am, docs/Makefile.in, tests/Makefile.am,
tests/Makefile.in: Convert to use Makefile.am
2003-03-04 Tuesday 02:53 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, version, samples/sample.ini,
tests/args.cnf: Changes for BSD/OS. Also potentially a bug in
FreeBSD.
2003-03-02 Sunday 16:35 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: More small document changes. Make HTML come out
a tad better.
2003-03-02 Sunday 15:28 Rocky Bernstein <rocky@cpan.org>
* ps-watcher.in.in: Update link for netwinder location!
2003-03-01 Saturday 21:38 Rocky Bernstein <rocky@cpan.org>
* MANIFEST: Typo.
2003-03-01 Saturday 21:37 Rocky Bernstein <rocky@cpan.org>
* NEWS: What's up.
2003-03-01 Saturday 21:35 Rocky Bernstein <rocky@cpan.org>
* MANIFEST: Add Changelog
2003-03-01 Saturday 21:23 Rocky Bernstein <rocky@cpan.org>
* samples/sample.ini: Add $args example.
2003-03-01 Saturday 21:12 Rocky Bernstein <rocky@cpan.org>
* MANIFEST, configure.ac, ps-watcher.in.in: Add variables to
control what ps can do, e.g. can nuke header line, has custom
title (for nuking header line), what time variable we can test
on.
2003-03-01 Saturday 21:09 Rocky Bernstein <rocky@cpan.org>
* tests/: .cvsignore, args.t.in, basic.cnf, basic.cnf.in: Don't
assume etime is a ps-variable. Thanks, FreeBSD.
2003-03-01 Saturday 21:08 Rocky Bernstein <rocky@cpan.org>
* docs/Makefile.in: Cater to brain-dead make on FreeBSD.
2003-02-28 Friday 16:45 Rocky Bernstein <rocky@cpan.org>
* MANIFEST, configure.ac: configure.ac: add freebsd4 check
MANIFEST: add args test files
2003-02-28 Friday 13:37 Rocky Bernstein <rocky@cpan.org>
* config.sub: Update with more recent version of this.
2003-02-28 Friday 12:34 Rocky Bernstein <rocky@cpan.org>
* tests/: .cvsignore, args.cnf, args.t.in: Add args regression
test.
2003-02-28 Friday 12:33 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, tests/Makefile.in,
tests/basic.cnf, tests/basic.t.in, tests/count.t.in: Add args
documentation and regression tests. count.t.in, basic.t.in: set
perl mode for emacs
2003-02-27 Thursday 23:46 Rocky Bernstein <rocky@cpan.org>
* configure.ac, ps-watcher.in.in, version: Add $args variable to
test on entire command. Perpare to make into another version.
2003-02-27 Thursday 21:21 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Add args to the list of variables that are
accepted.
2003-01-27 Monday 22:41 Rocky Bernstein <rocky@cpan.org>
* MANIFEST, configure.stamp, version: MANIFEST: configre.in ->
configure.ac Other files not sure about, but we'll try
initially...
2003-01-27 Monday 22:37 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Remove touch of stamp file. Dunno...
2003-01-27 Monday 22:35 Rocky Bernstein <rocky@cpan.org>
* configure.ac: Bump version number.
2003-01-27 Monday 22:34 Rocky Bernstein <rocky@cpan.org>
* Makefile.in, NEWS, configure.ac, configure.in, ps-watcher.in.in,
samples/sample.ini: Bug in running make dist.
Small documentation bug in manual and HTML. Had @PROGRAM@ rather
than @PACKAGE@ so name of package was not in man/html.
Give example where you want to match all processes except one.
Print out errors in configuration file
configure.in -> configure.ac (thanks, autoconf)
Config::IniConf now gives a syntax error for empty section: [].
Change that.
2002-10-03 Thursday 14:55 rocky
* .cvsignore: Seems to be a new thing with autoconf.
2002-10-03 Thursday 14:55 rocky
* home-page/index.html: Changes to move to sourceforge project:
download/manpage locations changed. Add link to CVS! And add
sourceforge logo.
2002-09-24 Tuesday 11:21 rocky
* NEWS: Update as appropriate.
2002-09-24 Tuesday 11:20 rocky
* Makefile.in: Bug in running post-configure when doing a "make
dist". Add "perl" to command.
2002-09-24 Tuesday 11:18 rocky
* ps-watcher.in.in: Add example which shows excluding a process
from consideration.
2002-09-24 Tuesday 11:00 rocky
* .cvsignore: post-configure is derived.
2002-09-24 Tuesday 10:59 rocky
* post-configure.in: Things that need to be done after running
configure. In particular, rewrinte #!/bin/perl lines.
2002-09-24 Tuesday 10:56 rocky
* NEWS: Document small doc bug. Version is now 0.96
2002-09-24 Tuesday 10:54 rocky
* ps-watcher.in.in: Document typo. Was using @PROGRAM@ instead of
@PACKAGE@.
2002-02-06 Wednesday 04:55 rocky
* MANIFEST: Now derived from post-configure.in
2002-02-06 Wednesday 04:54 rocky
* configure.in: Remove bsdstart -- space in it mess things up.
2002-02-06 Wednesday 04:13 rocky
* tests/basic.t.in: Turn into a derived file.
2002-02-06 Wednesday 04:13 rocky
* tests/: .cvsignore, count.t.in: .cvsignore: ignore derived tests
basic.t: is now derived count.t.in: new test
2002-02-06 Wednesday 04:10 rocky
* tests/count.cnf: count.cnf: test "none" and $count > 1 basic.cnf:
minor changes like cvs id line.
2002-02-06 Wednesday 04:10 rocky
* docs/Makefile.in: Makefile.in: migrating more to automake: use
@PACKAGE@ now.
2002-02-06 Wednesday 04:09 rocky
* Makefile.in, aclocal.m4, configure.in, missing, ps-watcher.in.in:
aclocal.m4 missing, Makefile: New files migrating more to
automake. ps-watcher.in.in: fix bug in "once" and "count > 1"
2001-11-24 Saturday 19:03 rocky
* home-page/index.html: Update location.
2001-06-25 Monday 00:23 rocky
* ps-watcher.in.in: Another example with count != 1 (syslogd)
changed to count > 4 (httpd). count != 1 may be confusing since
when count == 0 we don't trigger.
2001-06-25 Monday 00:22 rocky
* samples/sample.ini: Update to show occurs = none. syslogd
example was incorrect. Change to httpd.
2001-06-25 Monday 00:20 rocky
* tests/basic.cnf: Add test for when no matching process exists.
2001-06-25 Monday 00:17 rocky
* MANIFEST: Add NEWS
2001-06-25 Monday 00:16 rocky
* ps-watcher.in.in: Allow "occurs = none" to fire if no processes
exist. Update Copyright too.
2001-05-31 Thursday 16:24 rocky
* tests/basic.cnf: looks like [] is no longer valid.
2000-09-02 Saturday 18:51 rocky
* ps-watcher.in.in: Comment backtick problem
2000-09-02 Saturday 18:43 rocky
* ps-watcher.in.in: Hopefully this time we've fixed the backtick
problem in a process name.
Improve description section of doc.
2000-09-02 Saturday 04:07 rocky
* ps-watcher.in.in: Add --doc option to print text documentation.
Escape backticks in process names
2000-04-10 Monday 12:17 rocky
* home-page/index.html: Initial cut.
2000-04-09 Sunday 22:43 rocky
* THANKS: Out of babblefish.
2000-04-09 Sunday 22:25 rocky
* THANKS: Correct from pecarry-speak.
2000-04-09 Sunday 22:06 rocky
* README: This time for sure?
2000-04-09 Sunday 22:02 rocky
* ps-watcher.in.in: Add blank line after =pod for brain-dead
Red-Hat 6.1's brain-deat pod2man program.
2000-04-09 Sunday 21:58 rocky
* README: Change invocation example.
2000-04-09 Sunday 20:40 rocky
* samples/README: Correct file names. Add Id line.
2000-04-09 Sunday 20:39 rocky
* samples/sample.ini: Add Id line.
2000-04-09 Sunday 20:37 rocky
* samples/README: Document what each sample does.
2000-04-09 Sunday 20:37 rocky
* docs/Makefile.in: Makefile.in: add uninstall.
2000-04-09 Sunday 20:36 rocky
* Makefile.in, ps-watcher.in.in: Makefile.in: add uninstall.
post-configure: remove Open3 module check ps-watcher.in.in: Lots
of doc changes. Usage on finding no config file.
2000-04-09 Sunday 20:25 rocky
* README: Add quick instructions. Correct mistakes.
2000-04-09 Sunday 20:13 rocky
* MANIFEST: Add samples readme.
2000-03-27 Monday 01:54 rocky
* tests/.cvsignore: Guess we gotta add this one too.
2000-03-27 Monday 01:53 rocky
* tests/: Makefile.in, basic.cnf, driver: Now have some basic
tests.
2000-03-27 Monday 01:51 rocky
* .cvsignore, MANIFEST, Makefile.in, ps-watcher.in.in: MANIFEST:
it's a Perl thing. But probably a good idea Makefile.in now uses
it ps-watcher.in.in: remove uninitialized variables in
elapsed2secs
2000-03-22 Wednesday 07:11 rocky
* samples/sample.ini: Simple first.
2000-03-22 Wednesday 07:09 rocky
* samples/sample.ini: Show off more features.
2000-03-22 Wednesday 07:08 rocky
* Makefile.in, TODO, configure.in, ps-watcher.in.in: Makefile.in:
Deal with .in.in TODO: remove done things. Add others
(regresssion tests) ps-watcher.in.in: Add signal handling and
stating configuration file As is usual lots of doc changes.
2000-03-21 Tuesday 03:20 rocky
* Makefile.PL: To aid perl to GNU factions.
2000-03-21 Tuesday 03:17 rocky
* samples/: sample2.ini, solaris.ini: sampl2.ini: change for Linux.
2000-03-21 Tuesday 03:16 rocky
* docs/Makefile.in: Don't need L<> warning any more.
2000-03-21 Tuesday 03:15 rocky
* TODO, config.cache, configure.in, ps-watcher.in.in:
post-configure with IniConf version 0.97. ps-watcher.in.in -
many small changes for Linux ps output one token max (no
command) if no ps output skip to next line (ignore terminated
processes)
2000-03-21 Tuesday 02:23 rocky
* Makefile.in: Make dist works. Get config.guess, config.sub and
@PROGRAM@.in.in
2000-03-20 Monday 16:14 rocky
* configure.in: Add Linux stuff and tests/Makefile
2000-03-20 Monday 16:12 rocky
* ps-watcher.in.in: Doc changes.
2000-03-20 Monday 15:43 rocky
* configure.in: Substitute in PROGRAM.
2000-03-20 Monday 09:58 root
* Makefile.in, README, configure.in, ANNOUNCE, COPYING, INSTALL,
THANKS, TODO, config.cache, config.guess, config.sub, install-sh,
mkinstalldirs, ps-watcher.in.in, touch.pl, docs/Makefile.in,
samples/sample.ini, samples/sample2.ini, samples/solaris.ini:
Imported sources
2000-03-20 Monday 09:58 root
* Makefile.in, README, configure.in, ANNOUNCE, COPYING, INSTALL,
THANKS, TODO, config.cache, config.guess, config.sub, install-sh,
mkinstalldirs, ps-watcher.in.in, touch.pl, docs/Makefile.in,
samples/sample.ini, samples/sample2.ini, samples/solaris.ini:
Initial revision

182
INSTALL Normal file
View file

@ -0,0 +1,182 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

4
Makefile.PL Executable file
View file

@ -0,0 +1,4 @@
#/usr/bin/perl
print "Got'cha! This program uses ./configure.\n";
print "Just a moment while I transfer your call...\n";
exec "./configure";

67
Makefile.am Normal file
View file

@ -0,0 +1,67 @@
##############################################################################
# $Id: Makefile.am,v 1.14 2008/12/25 17:01:50 rockyb Exp $
# Copyright (C) 2003, 2004, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
##############################################################################
AUTOMAKE_OPTIONS = dist-bzip2
SUBDIRS = docs tests
noinst_SCRIPTS = post-configure.in touch.pl
EXTRA_DIST = post-configure.in ps-watcher.in.in ps-watcher \
touch.pl Makefile.PL \
samples/README \
samples/sample.ini \
samples/sample2.ini \
samples/port-watch.ini \
samples/root-procs.ini \
samples/solaris.ini
bin_SCRIPTS = ps-watcher
PERL = @PERL@
DISTCLEANFILES = ps-watcher ps-watcher.stamp
# The keeps automake from substituting PS_VARS
PS_VARS = ''
# Build all forms of documentation: manual-pages and HTML
test:
echo "Checking that things work.."; \
(cd tests && $(PERL) ./driver)
# A timestamp file is used to record whether or not we've created
# $(PROGRAM) from $(PROGRAM).in. During debugging if is often more
# convenient to modify $(PROGRAM) rather than $(PROGRAM).in.
$(PACKAGE).stamp: $(PACKAGE)
@cp -p $(PACKAGE) $(PACKAGE).in ; \
$(srcdir)/touch.pl $@
# cvs2cl
MAINTAINERCLEANFILES = ChangeLog
if MAINTAINER_MODE
.PHONY: ChangeLog
ChangeLog:
$(CVS2CL) -W 450 --header $(srcdir)/cvs2cl_header --utc -w -I ChangeLog --usermap $(srcdir)/cvs2cl_usermap -P
ACLOCAL_AMFLAGS=-I .
endif

676
Makefile.in Normal file
View file

@ -0,0 +1,676 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
##############################################################################
# $Id: Makefile.am,v 1.14 2008/12/25 17:01:50 rockyb Exp $
# Copyright (C) 2003, 2004, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
##############################################################################
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/post-configure.in \
$(srcdir)/ps-watcher.in.in $(top_srcdir)/configure AUTHORS \
COPYING ChangeLog INSTALL NEWS THANKS TODO config.guess \
config.sub install-sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = post-configure ps-watcher.in ps-watcher
am__installdirs = "$(DESTDIR)$(bindir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS)
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CVS2CL = @CVS2CL@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PS = @PS@
PS_ARGS = @PS_ARGS@
PS_ARGS_FMT = @PS_ARGS_FMT@
PS_CAN_RETURN_MULTIPLE_LINES = @PS_CAN_RETURN_MULTIPLE_LINES@
PS_CUSTOM_HEADER = @PS_CUSTOM_HEADER@
PS_FULLCMD_FMT = @PS_FULLCMD_FMT@
PS_NO_NULL_HEADER = @PS_NO_NULL_HEADER@
PS_PID_OPTS = @PS_PID_OPTS@
PS_TIME_VAR = @PS_TIME_VAR@
# The keeps automake from substituting PS_VARS
PS_VARS = ''
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = dist-bzip2
SUBDIRS = docs tests
noinst_SCRIPTS = post-configure.in touch.pl
EXTRA_DIST = post-configure.in ps-watcher.in.in ps-watcher \
touch.pl Makefile.PL \
samples/README \
samples/sample.ini \
samples/sample2.ini \
samples/port-watch.ini \
samples/root-procs.ini \
samples/solaris.ini
bin_SCRIPTS = ps-watcher
DISTCLEANFILES = ps-watcher ps-watcher.stamp
# cvs2cl
MAINTAINERCLEANFILES = ChangeLog
@MAINTAINER_MODE_TRUE@ACLOCAL_AMFLAGS = -I .
all: all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
post-configure: $(top_builddir)/config.status $(srcdir)/post-configure.in
cd $(top_builddir) && $(SHELL) ./config.status $@
ps-watcher.in: $(top_builddir)/config.status $(srcdir)/ps-watcher.in.in
cd $(top_builddir) && $(SHELL) ./config.status $@
ps-watcher: $(top_builddir)/config.status ps-watcher.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(SCRIPTS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-exec-am: install-binSCRIPTS
install-html: install-html-recursive
install-info: install-info-recursive
install-man:
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binSCRIPTS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binSCRIPTS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-binSCRIPTS
# Build all forms of documentation: manual-pages and HTML
test:
echo "Checking that things work.."; \
(cd tests && $(PERL) ./driver)
# A timestamp file is used to record whether or not we've created
# $(PROGRAM) from $(PROGRAM).in. During debugging if is often more
# convenient to modify $(PROGRAM) rather than $(PROGRAM).in.
$(PACKAGE).stamp: $(PACKAGE)
@cp -p $(PACKAGE) $(PACKAGE).in ; \
$(srcdir)/touch.pl $@
@MAINTAINER_MODE_TRUE@.PHONY: ChangeLog
@MAINTAINER_MODE_TRUE@ChangeLog:
@MAINTAINER_MODE_TRUE@ $(CVS2CL) -W 450 --header $(srcdir)/cvs2cl_header --utc -w -I ChangeLog --usermap $(srcdir)/cvs2cl_usermap -P
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

96
NEWS Normal file
View file

@ -0,0 +1,96 @@
Changes from 1.06 to 1.07 (December 25, 2008)
- Changed to include and tested on Darwin9
- A small number of bug fixes
Changes from 1.05 to 1.06 (March 10, 2006)
- Add minimal cygwin support; go over NetBSD and OpenBSD support
- Add --path option to specify path used in running commands
- ps-watcher wasn't terminating properly when given a signal. Thanks
to David G. Humes for noticing and fixing.
- Modernize code a little bit.
- Guard against unintialized variable conf_time
- Add BUGS section to manual to describe common problems.
- Add configure option to specify Perl location
Changes from 1.04 to 1.05 (May 18, 2005)
- Allow $ps_pat to be used in an action.
- Show how to use PROLOG to do non-ps-like things such as watching a
port (via lsof).
- OS tweeks: NetBSD works like FreeBSD, Darwin 7 works.
Changes from 1.03 to 1.04 (Jan 18, 2004)
- Add $PROLOG, $EPILOG and perl-action sections. Allows one to
accumulate information over all processes and take action on that.
- ps-variable order in GNU/Linux was changed to ensure that single-token
attributes don't get messed up by multiple-token attributes.
Changes from 1.02 to 1.03 (Nov 22, 2003)
- Add occurs=first-trigger to stop after first trigger rather than first
pattern match.
Changes from 1.01 to 1.02 (Sept 10, 2003)
Small bug fixes/feature enhancements and documentation fixes.
Changes from 1.0 to 1.01 (Aug 21, 2003)
- Log output (not syslog) now contains timestamp, program and process name
- Errors concerning getting ps information logged only at debug levels
- Add -w to perl invocation.
Changes from 0.99 to 1.0 (Jul 10, 2003)
Provision for ps returning multiple lines of output. (Solaris does this for
LWP processes)
make "make distcheck" work.
Changes from 0.98 to 0.99: (May 19, 2003)
Add AIX support, accomodate Darwin6.
Changes from 0.97 to 0.98: (Mar 5, 2003)
Works now on BSD/OS and Mac OS/X
Bug fix for FreeBSD.
Convert to use automake
Changes from 0.96 to 0.97: (Mar 1, 2003)
Portablity fixes - Now runs on FreeBSD.
Tested on the sourceforge compile farm.
Add $args variable to be able to use full ps command. Useful for working
with scripts that list the interpreter rather than the script name.
Changes from 0.95 to 0.96:
Bug in running make dist.
Small documentation bug in manual and HTML. Had @PROGRAM@ rather than
@PACKAGE@ so name of package was not in man/html.
Give example where you want to match all processes except one.
Print out errors in configuration file
configure.in -> configure.ac (thanks, autoconf)
Config::IniConf now gives a syntax error for empty section: [].
Change that.
Changes 0.93 - 0.95
Make "occurs = none" mean to run if there are no matching ps processes.
ps-watcher 0.93 -- first general release.
$Id: NEWS,v 1.28 2008/12/25 16:39:17 rockyb Exp $

41
README Normal file
View file

@ -0,0 +1,41 @@
This directory holds the distribution for ps-watcher, a program for
montoring a system via ps-like commands.
Short instructions. Type:
cd ps-watcher-*
make
If make fails you probably need to get IniConf. It it works then...
./ps-watcher --nosyslog --log --config ./samples/sample.ini
Read the documentation to understand what you did.
----
Documentation is in docs directory.
All of the source code is covered by the GNU GENERAL PUBLIC
LICENSE. See COPYING for details on this.
To use the program you will need Perl version 5.003 or greater
installed and the following modules:
Sys::Syslog
File::Basename
Config::IniFiles
Getopt::Long
The only one of these that is not part of the core Perl distribution
is Config::IniFiles which can be found at:
http://www.cpan.org/modules/by-module/Config/
In order to run the program you'll need a configuration file to
use. Some samples configuration files can be found in the samples
directory. See the README in that directory for a description of
what the configuration files do.
See INSTALL for generic GNU configure instructions.
$Id: README,v 1.7 2003/05/16 00:12:59 rockyb Exp $

29
THANKS Normal file
View file

@ -0,0 +1,29 @@
Thanks to various people I worked with at the Associated Press who
have made suggestions.
This program uses Config::IniFiles (originally called IniConf). Thus
thanks are due to Scott Hutton. Rich Bowen (rbowen@rcbowen.com) now
maintains Config::IniFiles and incorporated my changes to the program that
allow regular expressions to be specified in "section" heads.
Dave Humes - reporting regression between 1.04 and 1.05 in termination
code and why.
James R Grinter <jrg at acm dot org> suggested and provided code to allow the
program to fire when no matching processes (e.g. when a process that
should be running has died).
Thanks to Jason Welsh <jason at monsterjam dot org> for helping to track down
a Solaris problem where ps returned multiple lines of output.
Thanks to Iñaki Sánchez for the patch that allows one to use $ps_pat in
the action statement.
Musicological supervision by Stuart Frankel <gecko@dustyfeet.com>,
cutrate Ph.D.
$Id: THANKS,v 1.8 2006/03/08 19:17:33 rockyb Exp $

12
TODO Normal file
View file

@ -0,0 +1,12 @@
AIX and Linux ps allow custom output lines which means we can enclose
fields in quotes and thus allow variables which have embedded
blanks. Should make use of that.
For now we only can handle one configuration file. Should allow many.
Use IPC::Open3? -- it preserves STDERR and STDOUT. Backtick (`cmd`)
doesn't seem to.
Add more regression tests.
$Id: TODO,v 1.7 2003/07/10 11:50:21 rockyb Exp $

618
aclocal.m4 vendored Normal file
View file

@ -0,0 +1,618 @@
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(AC_AUTOCONF_VERSION, [2.61],,
[m4_warning([this file was generated for autoconf 2.61.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.10.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.10.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 13
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

1354
config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1410
config.sub vendored Executable file

File diff suppressed because it is too large Load diff

3758
configure vendored Executable file

File diff suppressed because it is too large Load diff

236
configure.ac Normal file
View file

@ -0,0 +1,236 @@
dnl
dnl Require autoconf version 2.50 or greater
dnl
dnl Copyright (C) 2004, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301 USA.
dnl $Id: configure.ac,v 1.43 2008/12/25 16:42:49 rockyb Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(ps-watcher.in.in)
AM_INIT_AUTOMAKE(ps-watcher,1.07)
AM_MISSING_PROG(CVS2CL, cvs2cl, $missing_dir)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
dnl =============================
dnl Checks for programs.
dnl =============================
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ARG_WITH(perl, AC_HELP_STRING([--with-perl],
[set path to Perl]), PERL=$withval)
## We use a path for perl so the #! line in autoscan will work.
AC_PATH_PROG(PERL, perl, no)
if test "$PERL" = no; then
AC_MSG_ERROR(Pssst... you need perl in order to use this program.\
Install it or put it in your path and try again.)
fi
AC_SUBST(PERL)dnl
AC_PATH_PROG(PS, ps, no)
AC_SUBST(PS)dnl
## PS_ARGS gives how we get the command line for a given PID. Also see
## description for PS_VARS.
AC_SUBST(PS_ARGS)
AC_SUBST(PS_ARGS_FMT)
AC_SUBST(PS_FULLCMD_FMT)
## PS_NO_NULL_HEADER indicates that we can't get rid of the PS header line
AC_SUBST(PS_NO_NULL_HEADER)
## PS_CAN_RETURN_MULTIPLE_LINES indicates the ps on this OS can return
## multiple lines for a process. Solaris's ps does this for processes
## which have many lwp (light-weight processes).
AC_SUBST(PS_CAN_RETURN_MULTIPLE_LINES)
## PS_CUSTOM_HEADER specifies whether we can put an = after the argument
## name to remove the header for that variable
AC_SUBST(PS_CUSTOM_HEADER)
## PS_PID_OPTS gives how to get the pid and command name needed for
##l first-level breakout.
AC_SUBST(PS_PID_OPTS)
## PS_TIME_VAR gives a variable that we can test time on
AC_SUBST(PS_TIME_VAR)
## PS_VAR gives a list of the PS variables we can query.
## However we must use only those variables that give output as a single
## token since these are parsed one token per variable. For example
## the arguments (args, or comm, or command) shouldn't be listed here.
AC_SUBST(PS_VARS)
## ========================================================================
## Need a better way to figure out ps options and to know
## which ones don't have embeded blanks or to parse ps output.
## ========================================================================
PS_ARGS_FMT=''
PS_FULLCMD_FMT=''
PS_TIME_VAR=''
case "$host_os" in
aix* )
PS_ARGS='-o args='
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=1
PS_NO_NULL_HEADER=0
PS_PID_OPTS='-e -o pid= -o comm='
PS_TIME_VAR='etime'
PS_VARS='user ruser group rgroup uid ruid gid rgid ppid
pgid pri cpu pcpu pmem vsz nice class scount thcount tid time
etime tty wchan bnd'
;;
cygwin* )
PS_ARGS='-l | cut -c 2-10,56-120'
PS_ARGS_FMT=['$opts{ps_prog} -l |cut -c 2-10,56-120|egrep \"^[ \\t]*%d\"']
PS_FULLCMD_FMT=['$opts{ps_prog} -l|cut -c 2-47,56-120|egrep \"^[ \\t]*%d\"']
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=0
PS_NO_NULL_HEADER=1
PS_PID_OPTS='-l | cut -c 2-10,56-120'
PS_VARS='pid ppid pgid winpid tty uid'
;;
solaris* )
PS_ARGS='-o args='
PS_CAN_RETURN_MULTIPLE_LINES=1
PS_CUSTOM_HEADER=1
PS_NO_NULL_HEADER=0
PS_PID_OPTS='-e -o pid= -o comm='
PS_TIME_VAR='etime'
PS_VARS='user ruser group rgroup uid ruid gid rgid ppid
pgid sid pri pcpu pmem vsz rss osz nice class time
etime stime f s lwp nlwp psr tty addr wchan fname'
;;
linux* )
PS_ARGS='-www -o args='
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=1
PS_NO_NULL_HEADER=0
PS_PID_OPTS='-e -o pid= -o cmd='
# Make sure we put known single tokens at the beginning like uid.
PS_VARS='uid euid ruid gid egid rgid alarm blocked bsdtime c caught
cputime drs dsiz egroup eip esp etime euser f fgid
fgroup flag flags fname fsgid fsgroup fsuid fsuser fuid fuser
group ignored intpri lim longtname m_drs m_trs maj_flt majflt
min_flt minflt ni nice nwchan opri pagein pcpu pending pgid pgrp
pmem ppid pri rgroup rss rssize rsz ruser s sess session
sgi_p sgi_rss sgid sgroup sid sig sig_block sig_catch sig_ignore
sig_pend sigcatch sigignore sigmask stackp start start_stack start_time
stat state stime suid suser svgid svgroup svuid svuser sz time timeout
tmout tname tpgid trs trss tsiz tt tty tty4 tty8 uid_hack uname
user vsize vsz wchan'
PS_TIME_VAR='etime'
;;
netbsdelf2* | openbsd* )
PS_ARGS='-o args'
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=0
PS_NO_NULL_HEADER=1
PS_PID_OPTS='-a -x -o pid= -o ucomm='
PS_VARS='acflag cpu f \
inblk jobc ktrace ktracep lim login majflt minflt msgrcv
msgsnd nice nivcsw nsigs nswap nvcsw nwchan oublk p_ru
paddr pagein pid ppid pri re rgid rlink rss rsz
ruid ruser sess sig sigcatch sigignore sigmask sl start state
svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user vsz
wchan xstat'
PS_TIME_VAR='cpu'
;;
netbsd* | freebsd4* )
PS_ARGS='-O command'
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=0
PS_NO_NULL_HEADER=1
PS_PID_OPTS='-a -x -o pid= -o ucomm='
PS_VARS='acflag cpu cputime f
inblk jobc ktrace ktracep lim login majflt minflt msgrcv
msgsnd nice nivcsw nsigs nswap nvcsw nwchan oublk p_ru
paddr pagein pid ppid pri re rgid rlink rss rsz
ruid ruser sess sig sigcatch sigignore sigmask sl start state
svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user vsz
wchan xstat'
PS_TIME_VAR='cputime'
;;
bsdi4* )
PS_ARGS='-www -o command'
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=0
PS_NO_NULL_HEADER=1
PS_PID_OPTS='-a -x -o pid= -o ucomm='
PS_TIME_VAR='cputime'
PS_VARS='acflag cpu cputime f \
inblk jobc ktrace ktracep lim login
nice nivcsw nsigs nswap nvcsw nwchan oublk p_ru
paddr pagein pid ppid pri re rgid rlink rss rsz
ruid ruser sess sig sigcatch sigignore sigmask sl start state
svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user vsz
wchan xstat'
;;
darwin5* | darwin6* | darwin7* | darwin8* | darwin9* )
PS_PID_OPTS='-a -x -o pid= -o ucomm'
PS_VARS='acflag cpu cputime f
inblk jobc ktrace ktracep lim login uid upr user vsz
nice nivcsw nsigs nswap nvcsw nwchan oublk p_ru
paddr pcpu pagein pid ppid pri re rgid rss rsz
ruid ruser sess sig sigmask sl start state
svgid svuid tdev time tpgid tsess tsiz tt tty ucomm
wchan xstat'
PS_TIME_VAR='cputime'
PS_ARGS='-www -o command'
PS_NO_NULL_HEADER=1
PS_CUSTOM_HEADER=0
PS_CAN_RETURN_MULTIPLE_LINES=0
;;
* )
echo "Don't know $host_os. Winging it."
PS_ARGS=''
PS_CAN_RETURN_MULTIPLE_LINES=0
PS_CUSTOM_HEADER=0
PS_NO_NULL_HEADER=1
PS_PID_OPTS='-e -o pid= -o comm='
PS_VARS='user ruser group rgroup uid ruid gid rgid ppid \
pgid sid pri pcpu pmem vsz rss osz nice class time \
etime stime tty addr wchan fname'
PS_TIME_VAR='etime'
esac
AC_CONFIG_FILES([post-configure], [chmod +x post-configure])
AC_CONFIG_FILES([tests/01.pod.t], [chmod +x tests/01.pod.t])
AC_CONFIG_FILES([tests/args.t], [chmod +x tests/args.t])
AC_CONFIG_FILES([tests/basic.t], [chmod +x tests/basic.t])
AC_CONFIG_FILES([tests/count.t], [chmod +x tests/count.t])
AC_CONFIG_FILES([tests/full.t], [chmod +x tests/full.t])
AC_CONFIG_FILES([ps-watcher.in])
AC_CONFIG_FILES([ps-watcher], [./post-configure $srcdir || exit 3])
AC_OUTPUT([
Makefile \
docs/Makefile \
tests/basic.cnf \
tests/Makefile \
])

40
docs/Makefile.am Normal file
View file

@ -0,0 +1,40 @@
##############################################################################
# $Id: Makefile.am,v 1.8 2005/05/17 09:53:00 rockyb Exp $
# Copyright (C) 2003, 2004 Rocky Bernstein
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
# Section 8 is system administration
EXT=8
man8_MANS = $(PACKAGE).$(EXT)
MOSTLYCLEANFILES = *~ $(man8_MANS) $(PACKAGE).html
EXTRA_DIST = $(man8_MANS) $(PACKAGE).html
DISTCLEANFILES = pod2htmi.tmp pod2htmd.tmp
# The keeps automake from substituting PS_VARS
PS_VARS = ''
# Files making up the documentation part of this package
DOCS = $(man_MANS) $(PACKAGE).html
# THIS SHOULD BE THE FIRST TARGET!
all: $(DOCS) Makefile
$(PACKAGE).html: ../$(PACKAGE).in
-pod2html --infile=../$(PACKAGE).in --outfile=$@
$(man8_MANS): ../$(PACKAGE).in
-pod2man --section=$(EXT) --name=$(PACKAGE) ../$(PACKAGE).in >$@

394
docs/Makefile.in Normal file
View file

@ -0,0 +1,394 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
##############################################################################
# $Id: Makefile.am,v 1.8 2005/05/17 09:53:00 rockyb Exp $
# Copyright (C) 2003, 2004 Rocky Bernstein
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = docs
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
man8dir = $(mandir)/man8
am__installdirs = "$(DESTDIR)$(man8dir)"
NROFF = nroff
MANS = $(man8_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CVS2CL = @CVS2CL@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PS = @PS@
PS_ARGS = @PS_ARGS@
PS_ARGS_FMT = @PS_ARGS_FMT@
PS_CAN_RETURN_MULTIPLE_LINES = @PS_CAN_RETURN_MULTIPLE_LINES@
PS_CUSTOM_HEADER = @PS_CUSTOM_HEADER@
PS_FULLCMD_FMT = @PS_FULLCMD_FMT@
PS_NO_NULL_HEADER = @PS_NO_NULL_HEADER@
PS_PID_OPTS = @PS_PID_OPTS@
PS_TIME_VAR = @PS_TIME_VAR@
# The keeps automake from substituting PS_VARS
PS_VARS = ''
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Section 8 is system administration
EXT = 8
man8_MANS = $(PACKAGE).$(EXT)
MOSTLYCLEANFILES = *~ $(man8_MANS) $(PACKAGE).html
EXTRA_DIST = $(man8_MANS) $(PACKAGE).html
DISTCLEANFILES = pod2htmi.tmp pod2htmd.tmp
# Files making up the documentation part of this package
DOCS = $(man_MANS) $(PACKAGE).html
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu docs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-man8: $(man8_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
8*) ;; \
*) ext='8' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
done
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
8*) ;; \
*) ext='8' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man: install-man8
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man8
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man8 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am uninstall-man uninstall-man8
# THIS SHOULD BE THE FIRST TARGET!
all: $(DOCS) Makefile
$(PACKAGE).html: ../$(PACKAGE).in
-pod2html --infile=../$(PACKAGE).in --outfile=$@
$(man8_MANS): ../$(PACKAGE).in
-pod2man --section=$(EXT) --name=$(PACKAGE) ../$(PACKAGE).in >$@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

740
docs/ps-watcher.8 Normal file
View file

@ -0,0 +1,740 @@
.\" Automatically generated by Pod::Man 2.17 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\&\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "ps-watcher 8"
.TH ps-watcher 8 "2008-12-25" "perl v5.8.8" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
ps\-watcher \- monitors various processes based on ps\-like information.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBps-watcher\fR [\fIoptions\fR...]
[\f(CW\*(C`\-\-config\*(C'\fR] \fIconfig-file\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Periodically a list of processes obtained via \f(CW\*(C`ps\*(C'\fR. More precisely
each item in the list contains the process name (just what's listed in
the \*(L"cmd\*(R" field, not the full command and arguments) and its process
id (pid). A configuration file specifies a list of Perl
regular-expression patterns to match the processes against. For each
match, a Perl expression specified for that pattern is evaluated. The
evaluated expression can refer to variables which are set by ps and
pertain to the matched process(es), for example the amount memory
consumed by the process, or the total elapsed time. Some other
variables are set by the program, such as the number of times the
process is running. If the Perl expression for a matched pattern
evaluates true, then an action can be run such as killing the program,
restarting it, or mailing an alert, or running some arbitrary Perl
code.
.PP
Some things you might want to watch a daemon or process for:
.IP "\(bu" 2
check that it is running (hasn't died)
.IP "\(bu" 2
ensure it is not running too many times
.IP "\(bu" 2
isn't consuming too much memory (perhaps a memory leak), or I/O
.PP
Some actions you might want to take:
.IP "\(bu" 2
restart a process
.IP "\(bu" 2
kill off rampant processes
.IP "\(bu" 2
send an alert about any of the conditions listed above
.PP
Depending on options specfied, this program can be run as a daemon,
run once (which is suitable as a \f(CW\*(C`cron\*(C'\fR job), or run not as a daemon
but still continuously (which may be handy in testing the program or
your configuration).
.Sh "\s-1OPTIONS\s0"
.IX Subsection "OPTIONS"
.IP "\-\-help" 4
.IX Item "--help"
Print a usage message on standard error and exit with a return code
of 100.
.Sp
.IP "\-\-doc" 4
.IX Item "--doc"
Extact the full documentation that you are reading now, print it and
exit with a return code of 101.
.Sp
.IP "\-\-version" 4
.IX Item "--version"
Print the version release on standard output and exit with a return
code of 10.
.Sp
.IP "\-\-debug \fInumber\fR" 4
.IX Item "--debug number"
Give debugging output. The higher the number, the more the output. The
default is 0 = none. 2 is the most debugging output.
.IP "[\-\-config] \fIconfiguration file\fR" 4
.IX Item "[--config] configuration file"
Specify configuration file. .
.Sp
See \*(L"\s-1CONFIGURATION\s0 \s-1FILE\s0 \s-1FORMAT\s0\*(R" below for information on the format
of the configuration file and \*(L"\s-1EXAMPLE\s0 \s-1CONFIGURATION\s0\*(R" for a complete
example of a configuration file.
.Sp
.IP "\-\-log [\fIlog file\fR]" 4
.IX Item "--log [log file]"
Send or don't send error and debugging output to a log file. If option
is given but no logfile is specified, then use \s-1STDERR\s0. The default is
no error log file. See also \-\-syslog below.
.Sp
.IP "\-\-syslog | \-\-nosyslog" 4
.IX Item "--syslog | --nosyslog"
Send or don't send error and debugging output to syslog. The default
is to syslog error and debug output.
.Sp
.IP "\-\-daemon | \-\-nodaemon" 4
.IX Item "--daemon | --nodaemon"
Run or don't as a daemon.
.Sp
.IP "\-\-path \fIsearch-path\fR" 4
.IX Item "--path search-path"
Specify the executable search path used in running commands.
.IP "\-\-ps\-prog \fIprogram\fR" 4
.IX Item "--ps-prog program"
One can specify the command that gives ps information. By default, the
command is \fI/bin/ps\fR.
.Sp
.IP "\-\-run | \-\-norun" 4
.IX Item "--run | --norun"
do/don't run actions go through the motions as though we were going
to. This may be useful in debugging.
.Sp
.IP "\-\-sleep \fIinterval in seconds\fR" 4
.IX Item "--sleep interval in seconds"
It is expected that one might want to run ps-watcher over and over
again. In such instances one can specify the amount of time between
iterations with this option.
.Sp
If a negative number is specified the program is run only once.
.Sp
.Sh "\s-1CONFIGURATION\s0 \s-1FILE\s0 \s-1MODIFICATION\s0 \s-1AND\s0 \s-1SIGNAL\s0 \s-1HANDLING\s0"
.IX Subsection "CONFIGURATION FILE MODIFICATION AND SIGNAL HANDLING"
Periodically ps-watcher checks to see if the configuration file
that it was run against has changed. If so, the program rereads the
configuration file.
.PP
More precisely, the checks are done after waking up from a slumber.
If the sleep interval is long (or if you are impatient), you can
probably force the program to wake up using a \s-1HUP\s0 signal.
.PP
At any time you can increase the level of debug output by sending a
\&\s-1USR1\s0 signal to the ps-watcher process. Similarly you can decrease the
level of debug output by sending the process a \s-1USR2\s0 signal.
.PP
It is recommended that you terminate ps-watcher via an \s-1INT\s0, \s-1TERM\s0, or \s-1QUIT\s0
signal.
.SH "CONFIGURATION FILE FORMAT"
.IX Header "CONFIGURATION FILE FORMAT"
The format of a configuration file is a series of fully qualified
filenames enclosed in square brackets followed by a number of
parameter lines. Each parameter line has a parameter name followed by
an \*(L"equal\*(R" sign and finally value. That is:
.PP
.Vb 5
\& # This is a comment line
\& ; So is this.
\& [process\-pattern1]
\& parameter1 = value1
\& parameter2 = value2
\&
\& [process\-pattern2]
\& parameter1 = value3
\& parameter2 = value4
.Ve
.PP
Comments start with # or ; and take effect to the end of the line.
.PP
This should be familiar to those who have worked with text-readible
Microsoft \f(CW\*(C`.INI\*(C'\fR files.
.PP
Note process patterns, (\fIprocess\-pattern1\fR and \fIprocess\-pattern2\fR
above) must be unique. If there are times when you may want to
refer to the same process, one can be creative to make these unique.
e.g. \fIcron\fR and \fI[c]ron\fR which refer to the same process even
though they \fIappear\fR to be different.
.PP
As quoted directly from the Config::IniFiles documentation:
.PP
Multiline or multivalued fields may also be defined ala \s-1UNIX\s0
\&\*(L"here document\*(R" syntax:
.PP
.Vb 4
\& Parameter=<<EOT
\& value/line 1
\& value/line 2
\& EOT
.Ve
.PP
You may use any string you want in place of \*(L"\s-1EOT\s0\*(R". Note
that what follows the \*(L"<<\*(R" and what appears at the end of
the text \fImust\fR match exactly, including any trailing
whitespace.
.PP
There are two special \*(L"process patterns\*(R": \f(CW$PROLOG\fR and \f(CW$EPILOG\fR, the
former should appear first and the latter last.
.PP
You can put perl code to initialize variables here and do cleanup
actions in these sections using \*(L"perl-action.\*(R"
.PP
A description of parameters names, their meanings and potential values
follows.
.IP "trigger" 4
.IX Item "trigger"
This parameter specifies the condition on which a process action is
fired. The condition is evaluated with Perl \fIeval()\fR and should
therefore return something which is equivalent to \*(L"true\*(R" in a Perl
expression.
.Sp
If no trigger is given in a section, true or 1 is assumed and
the action is unconditionally triggered.
.Sp
Example:
.Sp
.Vb 8
\& # Match if httpd has not spawned enough (<4) times. NFS and databases
\& # daemons typically spawn child processes. Since the program
\& # matches against the command names, not commands and arguments,
\& # something like: ps \-ef | grep httpd won\*(Aqt match the below.
\& # If you want to match against the command with arguments, see
\& # the example with $args below.
\& [httpd$]
\& trigger = $count <= 4
.Ve
.IP "occurs" 4
.IX Item "occurs"
This parameter specifies how many times an action should be performed
on processes matching the section trigger. Acceptable values are
\&\*(L"every\*(R", \*(L"first\*(R", \*(L"first-trigger\*(R", and \*(L"none\*(R".
.Sp
Setting the occurs value to \*(L"none\*(R" causes the the trigger to be
evaluated when there are no matching processes. Although one might
think \*(L"$count == 0\*(R" in the action expression would do the same thing,
currently as coded this does not work.
.Sp
Setting the occurs value to \*(L"first\*(R" causes the process-pattern rule to
be finished after handling the first rule that matches, whether or not the
trigger evaluated to true.
.Sp
Setting the occurs value to \*(L"first-trigger\*(R" causes the process-pattern
rule to be finished after handling the first rule that matches \fIand\fR
the trigger evaluates to true.
.Sp
If the item parameter is not specified, \*(L"first\*(R" is assumed.
.Sp
Examples:
.Sp
.Vb 3
\& [.]
\& occurs = first
\& action = echo "You have $count processes running"
\&
\& # Note in the above since there is no trigger specified,
\& # occurs = first
\& # is the same thing as
\& # occurs = first\-trigger
\&
\& [.?]
\& trigger = $vsz > 1000
\& occurs = every
\& action = echo "Large program $command matches $ps_pat: $vsz KB"
\&
\& # Fire if /usr/sbin/syslogd is not running.
\& # Since the program matches against the command names, not commands and
\& # arguments, something like:
\& # ps \-ef | grep /usr/sbin/syslogd
\& # won\*(Aqt match the below.
\& [(/usr/sbin/)?syslogd]
\& occurs = none
\& action = /etc/init.d/syslogd start
.Ve
.IP "action" 4
.IX Item "action"
This specifies the action, a command that gets run by the system
shell, when the trigger condition is evaluated to be true.
.Sp
Example:
.Sp
.Vb 1
\& action = /etc/init.d/market_loader.init restart
.Ve
.IP "perl-action" 4
.IX Item "perl-action"
This specifies Perl statements to be eval'd. This can be especially
useful in conjunction with \f(CW$PROLOG\fR and \f(CW$EPILOG\fR sections to make tests
across collections of process and do things which ps-watcher
would otherwise not be able to do.
.Sp
Example:
.Sp
.Vb 5
\& # A Perl variable initialization.
\& # Since ps\-watcher runs as a daemon it\*(Aqs a good idea
\& # to (re)initialize variables before each run.
\& [$PROLOG]
\& perl\-action = $root_procs=0;
\&
\& # Keep track of how many root processes we are running
\& [.*]
\& perl\-action = $root_procs++ if $uid == 0
\& occurs = every
\&
\& # Show this count.
\& [$EPILOG]
\& action = echo "I counted $root_procs root processes"
.Ve
.Sh "\s-1EXPANDED\s0 \s-1VARIABLES\s0 \s-1IN\s0 \s-1TRIGGER/ACTION\s0 \s-1CLAUSES\s0"
.IX Subsection "EXPANDED VARIABLES IN TRIGGER/ACTION CLAUSES"
Any variables defined in the program can be used in pattern or
action parameters. For example, \f(CW$program\fR can be used to refer to
the name of this program ps-watcher.
.PP
The following variables can be used in either the pattern or action
fields.
.ie n .IP "$action" 4
.el .IP "\f(CW$action\fR" 4
.IX Item "$action"
A string containing the text of the action to run.
.Sp
.ie n .IP "$perl_action" 4
.el .IP "\f(CW$perl_action\fR" 4
.IX Item "$perl_action"
A string containing the text of the perl_action to run.
.Sp
.ie n .IP "$ps_pat" 4
.el .IP "\f(CW$ps_pat\fR" 4
.IX Item "$ps_pat"
The Perl regular expression specified in the beginning of the section.
.Sp
.ie n .IP "$command" 4
.el .IP "\f(CW$command\fR" 4
.IX Item "$command"
The command that matched \f(CW$ps_pat\fR.
.Sp
The Perl regular expression specified in the beginning of the section.
Normally processes will not have funny characters in them. Just in
case, backticks in \f(CW$command\fR are escaped.
.Sp
Example:
.Sp
.Vb 2
\& # List processes other than emacs (which is a known pig) that use lots
\& # of virtual memory
\&
\& [.*]
\& trigger = $command !~ /emacs$/ && $vsz > 10
\& action = echo \e"Looks like you have a big \e$command program: \e$vsz KB\e"
.Ve
.Sp
.ie n .IP "$count" 4
.el .IP "\f(CW$count\fR" 4
.IX Item "$count"
The number of times the pattern matched. Presumably the number of
processes of this class running.
.Sp
.ie n .IP "$trigger" 4
.el .IP "\f(CW$trigger\fR" 4
.IX Item "$trigger"
A string containing the text of the trigger.
.PP
A list of variables specific to this program or fields commonly found in
\&\f(CW\*(C`ps\*(C'\fR output is listed below followed by a description of the more
common ones. See also \f(CW\*(C`ps\*(C'\fR for a more complete
description of the meaning of the field.
.PP
.Vb 11
\& uid euid ruid gid egid rgid alarm blocked bsdtime c caught
\&cputime drs dsiz egroup eip esp etime euser f fgid
\&fgroup flag flags fname fsgid fsgroup fsuid fsuser fuid fuser
\&group ignored intpri lim longtname m_drs m_trs maj_flt majflt
\&min_flt minflt ni nice nwchan opri pagein pcpu pending pgid pgrp
\&pmem ppid pri rgroup rss rssize rsz ruser s sess session
\&sgi_p sgi_rss sgid sgroup sid sig sig_block sig_catch sig_ignore
\&sig_pend sigcatch sigignore sigmask stackp start start_stack start_time
\&stat state stime suid suser svgid svgroup svuid svuser sz time timeout
\&tmout tname tpgid trs trss tsiz tt tty tty4 tty8 uid_hack uname
\&user vsize vsz wchan
.Ve
.PP
Beware though, in some situations ps can return multiple lines for a
single process and we will use just one of these in the trigger. In
particular, Solaris's \f(CW\*(C`ps\*(C'\fR will return a line for each \s-1LWP\s0 (light-weight
process). So on Solaris, if a trigger uses variable lwp, it may or may
not match depending on which single line of the multiple \f(CW\*(C`ps\*(C'\fR lines is
used.
.PP
.ie n .IP "$args" 4
.el .IP "\f(CW$args\fR" 4
.IX Item "$args"
The command along with its command arguments. It is possible that this
is might get truncated at certain length (if ps does likewise as is
the case on Solaris).
.Sp
.ie n .IP "$ppid" 4
.el .IP "\f(CW$ppid\fR" 4
.IX Item "$ppid"
The parent process id.
.Sp
.ie n .IP "$stime" 4
.el .IP "\f(CW$stime\fR" 4
.IX Item "$stime"
The start time of the process.
.Sp
.ie n .IP "$etime" 4
.el .IP "\f(CW$etime\fR" 4
.IX Item "$etime"
The end time of the process.
.Sp
.ie n .IP "$pmem" 4
.el .IP "\f(CW$pmem\fR" 4
.IX Item "$pmem"
The process memory.
.Sp
.ie n .IP "$pcpu" 4
.el .IP "\f(CW$pcpu\fR" 4
.IX Item "$pcpu"
The percent \s-1CPU\s0 utilization.
.Sp
.ie n .IP "$tty" 4
.el .IP "\f(CW$tty\fR" 4
.IX Item "$tty"
The controlling tty.
.Sp
.ie n .IP "$vsz" 4
.el .IP "\f(CW$vsz\fR" 4
.IX Item "$vsz"
Virtual memory size of the process
.Sh "\s-1OTHER\s0 \s-1THINGS\s0 \s-1IN\s0 \s-1TRIGGER\s0 \s-1CLAUSES\s0"
.IX Subsection "OTHER THINGS IN TRIGGER CLAUSES"
To make testing against elapsed time easier, a function \f(CW\*(C`elapse2sec()\*(C'\fR
has been written to parse and convert elapsed time strings in the
format \f(CW\*(C`dd\-hh:mm:ss\*(C'\fR and a number of seconds.
.PP
Some constants for the number of seconds in a minute, hour, or day
have also been defined. These are referred to as \f(CW\*(C`MINS\*(C'\fR, \f(CW\*(C`HOURS\*(C'\fR,
and \f(CW\*(C`DAYS\*(C'\fR respectively and they have the expected definitions:
.PP
.Vb 3
\& use constant MINS => 60;
\& use constant HOURS => 60*60;
\& use constant DAYS => HOURS * 24;
.Ve
.PP
Here is an example of the use of \f(CW\*(C`elapsed2sec()\*(C'\fR:
.PP
.Vb 7
\& # Which processes have been running for more than 3 hours?
\& # Also note use of builtin\-function elapsed2secs, variable $etime
\& # and builtin\-function HOURS
\& [.]
\& trigger = elapsed2secs(\*(Aq$etime\*(Aq) > 1*DAYS
\& action = echo "$command has been running more than 1 day ($etime)"
\& occurs = every
.Ve
.PP
Please note the quotes around '$etime'.
.SH "EXAMPLE CONFIGURATION"
.IX Header "EXAMPLE CONFIGURATION"
.Vb 1
\& # Comments start with # or ; and go to the end of the line.
\&
\& # The format for each entry is in Microsoft .INI form:
\& # [process\-pattern]
\& # trigger = perl\-expression
\& # action = program\-and\-arguments\-to\-run
\&
\& [httpd$]
\& trigger = $count < 4
\& action = echo "$trigger fired \-\- You have $count httpd sessions."
\&
\& [.]
\& trigger = $vsz > 10
\& action = echo "Looks like you have a big $command program: $vsz KB"
\&
\& # Unfortunately we have use a different pattern below. (Here we use
\& # ".?" instead of ".".) In effect the the two patterns mean
\& # test every process.
\& [.?]
\& trigger = elapsed2secs(\*(Aq$etime\*(Aq) > 2*MINS && $pcpu > 40
\& occurs = every
\& action = <<EOT
\& echo "$command used $pcpu% CPU for the last $etime seconds" | /bin/mail root
\& kill \-TERM $pid
\& EOT
\&
\& # Scripts don\*(Aqt show as the script name as the command name on some
\& # operating systems. Rather the name of the interpreter is listed
\& # (e.g. bash or perl) Here\*(Aqs how you can match against a script.
\& # BSD/OS is an exception: it does give the script name rather than
\& # the interpreter name.
\& [/usr/bin/perl]
\& trigger = \e$args !~ /ps\-watcher/
\& occurs = every
\& action = echo "***found perl program ${pid}:\en $args"
.Ve
.ie n .SH "Using $PROLOG for getting non-ps information"
.el .SH "Using \f(CW$PROLOG\fP for getting non-ps information"
.IX Header "Using $PROLOG for getting non-ps information"
Here is an example to show how to use ps-watcher to do something not
really possible from ps: check to see if a \fIport\fR is active. We make
use of lsof to check port 3333 and the \f(CW$PROLOG\fR make sure it runs.
.PP
.Vb 6
\& [$PROLOG]
\& occurs = first
\& trigger = { \e$x=\`lsof \-i :3333 >/dev/null 2>&1\`; \e$? >> 8 }
\& action = <<EOT
\& put\-your\-favorite\-command\-here arg1 arg2 ...
\& EOT
.Ve
.SH "SECURITY CONSIDERATIONS"
.IX Header "SECURITY CONSIDERATIONS"
Any daemon such as this one which is sufficiently flexible is a
security risk. The configuration file allows arbitrary commands to be
run. In particular if this daemon is run as root and the configuration
file is not protected so that it can't be modified, a bad person could
have their programs run as root.
.PP
There's nothing in the ps command or ps-watcher, that requires one to
run this daemon as root.
.PP
So as with all daemons, one needs to take usual security precautions
that a careful sysadmin/maintainer of a computer would. If you can run
any daemon as an unprivileged user (or with no privileges), do it! If
not, set the permissions on the configuration file and the directory
it lives in.
.PP
This program can also run chrooted and there is a \f(CW\*(C`\-\-path\*(C'\fR option
that is available which can be used to set the executable search path.
All commands used by ps-watcher are fully qualified, and I generally
give a full execution path in my configuration file, so consider using
the option \f(CW\*(C`\-\-path=\*(Aq\*(Aq\*(C'\fR.
.PP
Commands that need to be run as root you can run via \f(CW\*(C`sudo\*(C'\fR. I often
run process accounting which tracks all commands run. Tripwire may be
useful to track changed configuration files.
.SH "TROUBLESHOOTING"
.IX Header "TROUBLESHOOTING"
To debug a configuration file the following options are useful:
.PP
.Vb 1
\& ps\-watcher \-\-log \-\-nodaemon \-\-sleep \-1 \-\-debug 2 *config\-file*
.Ve
.PP
For even more information and control try running the above under the
perl debugger, e.g.
.PP
.Vb 1
\& perl \-d ps\-watcher \-\-log \-\-nodaemon \-\-sleep \-1 \-\-debug 2 *config\-file*
.Ve
.SH "BUGS"
.IX Header "BUGS"
Well, some of these are not so much a bug in ps-watcher so much as a
challenge to getting ps-watcher to do what you want it to do.
.PP
One common problem people run in into is understanding exactly what
the process variables mean. The manual page \fIps\fR\|(1) should be of
help, but I've found some of the descriptions either a bit vague or
just plain lacking.
.PP
Sometimes one will see this error message when debug tracing is turned on:
.PP
.Vb 1
\& ** debug ** Something wrong getting ps variables
.Ve
.PP
This just means that the process died between the time ps-watcher first
saw the existence of the process and the time that it queried
variables.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
See also \fIps\fR\|(1) and \fIsyslogd\fR\|(8).
.PP
Another cool program doing ps-like things is \f(CW\*(C`xps\*(C'\fR. Well okay, it's
another program I distributed. It shows the process tree dynamically
updated using X Motif and tries to display the output \*(L"attractively\*(R"
but fast. You can the find the homepage at
<http://motif\-pstree.sourceforge.net> and it download via
<http://prdownloads.sourceforge.net/motif\-pstree?sort_by=date&sort=desc>
.SH "AUTHOR"
.IX Header "AUTHOR"
Rocky Bernstein (rocky@gnu.org)
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
.Vb 6
\& Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008
\& Rocky Bernstein, email: rocky@gnu.org.
\& This program is free software; you can redistribute it and/or modify
\& it under the terms of the GNU General Public License as published by
\& the Free Software Foundation; either version 2 of the License, or
\& (at your option) any later version.
\&
\& This program is distributed in the hope that it will be useful,
\& but WITHOUT ANY WARRANTY; without even the implied warranty of
\& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\& GNU General Public License for more details.
\&
\& You should have received a copy of the GNU General Public License
\& along with this program; if not, write to the Free Software
\& Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
.Ve

644
docs/ps-watcher.html Normal file
View file

@ -0,0 +1,644 @@
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ps-watcher - monitors various processes based on ps-like information.</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#options">OPTIONS</a></li>
<li><a href="#configuration_file_modification_and_signal_handling">CONFIGURATION FILE MODIFICATION AND SIGNAL HANDLING</a></li>
</ul>
<li><a href="#configuration_file_format">CONFIGURATION FILE FORMAT</a></li>
<ul>
<li><a href="#expanded_variables_in_trigger_action_clauses">EXPANDED VARIABLES IN TRIGGER/ACTION CLAUSES</a></li>
<li><a href="#other_things_in_trigger_clauses">OTHER THINGS IN TRIGGER CLAUSES</a></li>
</ul>
<li><a href="#example_configuration">EXAMPLE CONFIGURATION</a></li>
<li><a href="#using__prolog_for_getting_nonps_information">Using $PROLOG for getting non-ps information</a></li>
<li><a href="#security_considerations">SECURITY CONSIDERATIONS</a></li>
<li><a href="#troubleshooting">TROUBLESHOOTING</a></li>
<li><a href="#bugs">BUGS</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ps-watcher - monitors various processes based on ps-like information.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p><strong>ps-watcher</strong> [<em>options</em>...]
[<code>--config</code>] <em>config-file</em></p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Periodically a list of processes obtained via <code>ps</code>. More precisely
each item in the list contains the process name (just what's listed in
the ``cmd'' field, not the full command and arguments) and its process
id (pid). A configuration file specifies a list of Perl
regular-expression patterns to match the processes against. For each
match, a Perl expression specified for that pattern is evaluated. The
evaluated expression can refer to variables which are set by ps and
pertain to the matched process(es), for example the amount memory
consumed by the process, or the total elapsed time. Some other
variables are set by the program, such as the number of times the
process is running. If the Perl expression for a matched pattern
evaluates true, then an action can be run such as killing the program,
restarting it, or mailing an alert, or running some arbitrary Perl
code.</p>
<p>Some things you might want to watch a daemon or process for:</p>
<ul>
<li>
<p>check that it is running (hasn't died)</p>
</li>
<li>
<p>ensure it is not running too many times</p>
</li>
<li>
<p>isn't consuming too much memory (perhaps a memory leak), or I/O</p>
</li>
</ul>
<p>Some actions you might want to take:</p>
<ul>
<li>
<p>restart a process</p>
</li>
<li>
<p>kill off rampant processes</p>
</li>
<li>
<p>send an alert about any of the conditions listed above</p>
</li>
</ul>
<p>Depending on options specfied, this program can be run as a daemon,
run once (which is suitable as a <code>cron</code> job), or run not as a daemon
but still continuously (which may be handy in testing the program or
your configuration).</p>
<p>
</p>
<h2><a name="options">OPTIONS</a></h2>
<dl>
<dt><strong><a name="item__2d_2dhelp">--help</a></strong></dt>
<dd>
<p>Print a usage message on standard error and exit with a return code
of 100.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2ddoc">--doc</a></strong></dt>
<dd>
<p>Extact the full documentation that you are reading now, print it and
exit with a return code of 101.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2dversion">--version</a></strong></dt>
<dd>
<p>Print the version release on standard output and exit with a return
code of 10.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2ddebug_number">--debug <em>number</em></a></strong></dt>
<dd>
<p>Give debugging output. The higher the number, the more the output. The
default is 0 = none. 2 is the most debugging output.</p>
</dd>
<dt><strong><a name="item__5b_2d_2dconfig_5d_configuration_file">[--config] <em>configuration file</em></a></strong></dt>
<dd>
<p>Specify configuration file. .</p>
<p>See <a href="#configuration_file_format">CONFIGURATION FILE FORMAT</a> below for information on the format
of the configuration file and <a href="#example_configuration">EXAMPLE CONFIGURATION</a> for a complete
example of a configuration file.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2dlog__5blog_file_5d">--log [<em>log file</em>]</a></strong></dt>
<dd>
<p>Send or don't send error and debugging output to a log file. If option
is given but no logfile is specified, then use STDERR. The default is
no error log file. See also --syslog below.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2dsyslog__7c__2d_2dnosyslog">--syslog | --nosyslog</a></strong></dt>
<dd>
<p>Send or don't send error and debugging output to syslog. The default
is to syslog error and debug output.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2ddaemon__7c__2d_2dnodaemon">--daemon | --nodaemon</a></strong></dt>
<dd>
<p>Run or don't as a daemon.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2dpath_search_2dpath">--path <em>search-path</em></a></strong></dt>
<dd>
<p>Specify the executable search path used in running commands.</p>
</dd>
<dt><strong><a name="item__2d_2dps_2dprog_program">--ps-prog <em>program</em></a></strong></dt>
<dd>
<p>One can specify the command that gives ps information. By default, the
command is <em>/bin/ps</em>.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2drun__7c__2d_2dnorun">--run | --norun</a></strong></dt>
<dd>
<p>do/don't run actions go through the motions as though we were going
to. This may be useful in debugging.</p>
<p></p>
</dd>
<dt><strong><a name="item__2d_2dsleep_interval_in_seconds">--sleep <em>interval in seconds</em></a></strong></dt>
<dd>
<p>It is expected that one might want to run ps-watcher over and over
again. In such instances one can specify the amount of time between
iterations with this option.</p>
<p>If a negative number is specified the program is run only once.</p>
<p></p>
</dd>
</dl>
<p>
</p>
<h2><a name="configuration_file_modification_and_signal_handling">CONFIGURATION FILE MODIFICATION AND SIGNAL HANDLING</a></h2>
<p>Periodically ps-watcher checks to see if the configuration file
that it was run against has changed. If so, the program rereads the
configuration file.</p>
<p>More precisely, the checks are done after waking up from a slumber.
If the sleep interval is long (or if you are impatient), you can
probably force the program to wake up using a HUP signal.</p>
<p>At any time you can increase the level of debug output by sending a
USR1 signal to the ps-watcher process. Similarly you can decrease the
level of debug output by sending the process a USR2 signal.</p>
<p>It is recommended that you terminate ps-watcher via an INT, TERM, or QUIT
signal.</p>
<p>
</p>
<hr />
<h1><a name="configuration_file_format">CONFIGURATION FILE FORMAT</a></h1>
<p>The format of a configuration file is a series of fully qualified
filenames enclosed in square brackets followed by a number of
parameter lines. Each parameter line has a parameter name followed by
an ``equal'' sign and finally value. That is:</p>
<pre>
# This is a comment line
; So is this.
[process-pattern1]
parameter1 = value1
parameter2 = value2</pre>
<pre>
[process-pattern2]
parameter1 = value3
parameter2 = value4</pre>
<p>Comments start with # or ; and take effect to the end of the line.</p>
<p>This should be familiar to those who have worked with text-readible
Microsoft <code>.INI</code> files.</p>
<p>Note process patterns, (<em>process-pattern1</em> and <em>process-pattern2</em>
above) must be unique. If there are times when you may want to
refer to the same process, one can be creative to make these unique.
e.g. <em>cron</em> and <em>[c]ron</em> which refer to the same process even
though they <em>appear</em> to be different.</p>
<p>As quoted directly from the Config::IniFiles documentation:</p>
<p>Multiline or multivalued fields may also be defined ala UNIX
``here document'' syntax:</p>
<pre>
Parameter=&lt;&lt;EOT
value/line 1
value/line 2
EOT</pre>
<p>You may use any string you want in place of ``EOT''. Note
that what follows the ``&lt;&lt;'' and what appears at the end of
the text <em>must</em> match exactly, including any trailing
whitespace.</p>
<p>There are two special ``process patterns'': $PROLOG and $EPILOG, the
former should appear first and the latter last.</p>
<p>You can put perl code to initialize variables here and do cleanup
actions in these sections using ``perl-action.''</p>
<p>A description of parameters names, their meanings and potential values
follows.</p>
<dl>
<dt><strong><a name="item_trigger">trigger</a></strong></dt>
<dd>
<p>This parameter specifies the condition on which a process action is
fired. The condition is evaluated with Perl <code>eval()</code> and should
therefore return something which is equivalent to ``true'' in a Perl
expression.</p>
<p>If no trigger is given in a section, true or 1 is assumed and
the action is unconditionally triggered.</p>
<p>Example:</p>
<pre>
# Match if httpd has not spawned enough (&lt;4) times. NFS and databases
# daemons typically spawn child processes. Since the program
# matches against the command names, not commands and arguments,
# something like: ps -ef | grep httpd won't match the below.
# If you want to match against the command with arguments, see
# the example with $args below.
[httpd$]
trigger = $count &lt;= 4</pre>
</dd>
<dt><strong><a name="item_occurs">occurs</a></strong></dt>
<dd>
<p>This parameter specifies how many times an action should be performed
on processes matching the section trigger. Acceptable values are
``every'', ``first'', ``first-trigger'', and ``none''.</p>
<p>Setting the occurs value to ``none'' causes the the trigger to be
evaluated when there are no matching processes. Although one might
think ``$count == 0'' in the action expression would do the same thing,
currently as coded this does not work.</p>
<p>Setting the occurs value to ``first'' causes the process-pattern rule to
be finished after handling the first rule that matches, whether or not the
trigger evaluated to true.</p>
<p>Setting the occurs value to ``first-trigger'' causes the process-pattern
rule to be finished after handling the first rule that matches <em>and</em>
the trigger evaluates to true.</p>
<p>If the item parameter is not specified, ``first'' is assumed.</p>
<p>Examples:</p>
<pre>
[.]
occurs = first
action = echo &quot;You have $count processes running&quot;</pre>
<pre>
# Note in the above since there is no trigger specified,
# occurs = first
# is the same thing as
# occurs = first-trigger</pre>
<pre>
[.?]
trigger = $vsz &gt; 1000
occurs = every
action = echo &quot;Large program $command matches $ps_pat: $vsz KB&quot;</pre>
<pre>
# Fire if /usr/sbin/syslogd is not running.
# Since the program matches against the command names, not commands and
# arguments, something like:
# ps -ef | grep /usr/sbin/syslogd
# won't match the below.
[(/usr/sbin/)?syslogd]
occurs = none
action = /etc/init.d/syslogd start</pre>
</dd>
<dt><strong><a name="item_action">action</a></strong></dt>
<dd>
<p>This specifies the action, a command that gets run by the system
shell, when the trigger condition is evaluated to be true.</p>
<p>Example:</p>
<pre>
action = /etc/init.d/market_loader.init restart</pre>
</dd>
<dt><strong><a name="item_perl_2daction">perl-action</a></strong></dt>
<dd>
<p>This specifies Perl statements to be eval'd. This can be especially
useful in conjunction with $PROLOG and $EPILOG sections to make tests
across collections of process and do things which ps-watcher
would otherwise not be able to do.</p>
<p>Example:</p>
<pre>
# A Perl variable initialization.
# Since ps-watcher runs as a daemon it's a good idea
# to (re)initialize variables before each run.
[$PROLOG]
perl-action = $root_procs=0;</pre>
<pre>
# Keep track of how many root processes we are running
[.*]
perl-action = $root_procs++ if $uid == 0
occurs = every</pre>
<pre>
# Show this count.
[$EPILOG]
action = echo &quot;I counted $root_procs root processes&quot;</pre>
</dd>
</dl>
<p>
</p>
<h2><a name="expanded_variables_in_trigger_action_clauses">EXPANDED VARIABLES IN TRIGGER/ACTION CLAUSES</a></h2>
<p>Any variables defined in the program can be used in pattern or
action parameters. For example, <code>$program</code> can be used to refer to
the name of this program ps-watcher.</p>
<p>The following variables can be used in either the pattern or action
fields.</p>
<dl>
<dt><strong><a name="item__action">$action</a></strong></dt>
<dd>
<p>A string containing the text of the action to run.</p>
<p></p>
</dd>
<dt><strong><a name="item__perl_action">$perl_action</a></strong></dt>
<dd>
<p>A string containing the text of the perl_action to run.</p>
<p></p>
</dd>
<dt><strong><a name="item__ps_pat">$ps_pat</a></strong></dt>
<dd>
<p>The Perl regular expression specified in the beginning of the section.</p>
<p></p>
</dd>
<dt><strong><a name="item__command">$command</a></strong></dt>
<dd>
<p>The command that matched $ps_pat.</p>
<p>The Perl regular expression specified in the beginning of the section.
Normally processes will not have funny characters in them. Just in
case, backticks in $command are escaped.</p>
<p>Example:</p>
<pre>
# List processes other than emacs (which is a known pig) that use lots
# of virtual memory</pre>
<pre>
[.*]
trigger = $command !~ /emacs$/ &amp;&amp; $vsz &gt; 10
action = echo \&quot;Looks like you have a big \$command program: \$vsz KB\&quot;</pre>
<p></p>
</dd>
<dt><strong><a name="item__count">$count</a></strong></dt>
<dd>
<p>The number of times the pattern matched. Presumably the number of
processes of this class running.</p>
<p></p>
</dd>
<dt><strong><a name="item__trigger">$trigger</a></strong></dt>
<dd>
<p>A string containing the text of the trigger.</p>
</dd>
</dl>
<p>A list of variables specific to this program or fields commonly found in
<code>ps</code> output is listed below followed by a description of the more
common ones. See also <code>ps</code> for a more complete
description of the meaning of the field.</p>
<pre>
uid euid ruid gid egid rgid alarm blocked bsdtime c caught
cputime drs dsiz egroup eip esp etime euser f fgid
fgroup flag flags fname fsgid fsgroup fsuid fsuser fuid fuser
group ignored intpri lim longtname m_drs m_trs maj_flt majflt
min_flt minflt ni nice nwchan opri pagein pcpu pending pgid pgrp
pmem ppid pri rgroup rss rssize rsz ruser s sess session
sgi_p sgi_rss sgid sgroup sid sig sig_block sig_catch sig_ignore
sig_pend sigcatch sigignore sigmask stackp start start_stack start_time
stat state stime suid suser svgid svgroup svuid svuser sz time timeout
tmout tname tpgid trs trss tsiz tt tty tty4 tty8 uid_hack uname
user vsize vsz wchan</pre>
<p>Beware though, in some situations ps can return multiple lines for a
single process and we will use just one of these in the trigger. In
particular, Solaris's <code>ps</code> will return a line for each LWP (light-weight
process). So on Solaris, if a trigger uses variable lwp, it may or may
not match depending on which single line of the multiple <code>ps</code> lines is
used.</p>
<p></p>
<dl>
<dt><strong><a name="item__args">$args</a></strong></dt>
<dd>
<p>The command along with its command arguments. It is possible that this
is might get truncated at certain length (if ps does likewise as is
the case on Solaris).</p>
<p></p>
</dd>
<dt><strong><a name="item__ppid">$ppid</a></strong></dt>
<dd>
<p>The parent process id.</p>
<p></p>
</dd>
<dt><strong><a name="item__stime">$stime</a></strong></dt>
<dd>
<p>The start time of the process.</p>
<p></p>
</dd>
<dt><strong><a name="item__etime">$etime</a></strong></dt>
<dd>
<p>The end time of the process.</p>
<p></p>
</dd>
<dt><strong><a name="item__pmem">$pmem</a></strong></dt>
<dd>
<p>The process memory.</p>
<p></p>
</dd>
<dt><strong><a name="item__pcpu">$pcpu</a></strong></dt>
<dd>
<p>The percent CPU utilization.</p>
<p></p>
</dd>
<dt><strong><a name="item__tty">$tty</a></strong></dt>
<dd>
<p>The controlling tty.</p>
<p></p>
</dd>
<dt><strong><a name="item__vsz">$vsz</a></strong></dt>
<dd>
<p>Virtual memory size of the process</p>
</dd>
</dl>
<p>
</p>
<h2><a name="other_things_in_trigger_clauses">OTHER THINGS IN TRIGGER CLAUSES</a></h2>
<p>To make testing against elapsed time easier, a function <code>elapse2sec()</code>
has been written to parse and convert elapsed time strings in the
format <code>dd-hh:mm:ss</code> and a number of seconds.</p>
<p>Some constants for the number of seconds in a minute, hour, or day
have also been defined. These are referred to as <code>MINS</code>, <code>HOURS</code>,
and <code>DAYS</code> respectively and they have the expected definitions:</p>
<pre>
use constant MINS =&gt; 60;
use constant HOURS =&gt; 60*60;
use constant DAYS =&gt; HOURS * 24;</pre>
<p>Here is an example of the use of <code>elapsed2sec()</code>:</p>
<pre>
# Which processes have been running for more than 3 hours?
# Also note use of builtin-function elapsed2secs, variable $etime
# and builtin-function HOURS
[.]
trigger = elapsed2secs('$etime') &gt; 1*DAYS
action = echo &quot;$command has been running more than 1 day ($etime)&quot;
occurs = every</pre>
<p>Please note the quotes around '$etime'.</p>
<p>
</p>
<hr />
<h1><a name="example_configuration">EXAMPLE CONFIGURATION</a></h1>
<pre>
# Comments start with # or ; and go to the end of the line.</pre>
<pre>
# The format for each entry is in Microsoft .INI form:
# [process-pattern]
# trigger = perl-expression
# action = program-and-arguments-to-run</pre>
<pre>
[httpd$]
trigger = $count &lt; 4
action = echo &quot;$trigger fired -- You have $count httpd sessions.&quot;</pre>
<pre>
[.]
trigger = $vsz &gt; 10
action = echo &quot;Looks like you have a big $command program: $vsz KB&quot;</pre>
<pre>
# Unfortunately we have use a different pattern below. (Here we use
# &quot;.?&quot; instead of &quot;.&quot;.) In effect the the two patterns mean
# test every process.
[.?]
trigger = elapsed2secs('$etime') &gt; 2*MINS &amp;&amp; $pcpu &gt; 40
occurs = every
action = &lt;&lt;EOT
echo &quot;$command used $pcpu% CPU for the last $etime seconds&quot; | /bin/mail root
kill -TERM $pid
EOT</pre>
<pre>
# Scripts don't show as the script name as the command name on some
# operating systems. Rather the name of the interpreter is listed
# (e.g. bash or perl) Here's how you can match against a script.
# BSD/OS is an exception: it does give the script name rather than
# the interpreter name.
[/usr/bin/perl]
trigger = \$args !~ /ps-watcher/
occurs = every
action = echo &quot;***found perl program ${pid}:\n $args&quot;</pre>
<p>
</p>
<hr />
<h1><a name="using__prolog_for_getting_nonps_information">Using $PROLOG for getting non-ps information</a></h1>
<p>Here is an example to show how to use ps-watcher to do something not
really possible from ps: check to see if a <em>port</em> is active. We make
use of lsof to check port 3333 and the $PROLOG make sure it runs.</p>
<pre>
[$PROLOG]
occurs = first
trigger = { \$x=`lsof -i :3333 &gt;/dev/null 2&gt;&amp;1`; \$? &gt;&gt; 8 }
action = &lt;&lt;EOT
put-your-favorite-command-here arg1 arg2 ...
EOT</pre>
<p>
</p>
<hr />
<h1><a name="security_considerations">SECURITY CONSIDERATIONS</a></h1>
<p>Any daemon such as this one which is sufficiently flexible is a
security risk. The configuration file allows arbitrary commands to be
run. In particular if this daemon is run as root and the configuration
file is not protected so that it can't be modified, a bad person could
have their programs run as root.</p>
<p>There's nothing in the ps command or ps-watcher, that requires one to
run this daemon as root.</p>
<p>So as with all daemons, one needs to take usual security precautions
that a careful sysadmin/maintainer of a computer would. If you can run
any daemon as an unprivileged user (or with no privileges), do it! If
not, set the permissions on the configuration file and the directory
it lives in.</p>
<p>This program can also run chrooted and there is a <code>--path</code> option
that is available which can be used to set the executable search path.
All commands used by ps-watcher are fully qualified, and I generally
give a full execution path in my configuration file, so consider using
the option <code>--path=''</code>.</p>
<p>Commands that need to be run as root you can run via <code>sudo</code>. I often
run process accounting which tracks all commands run. Tripwire may be
useful to track changed configuration files.</p>
<p>
</p>
<hr />
<h1><a name="troubleshooting">TROUBLESHOOTING</a></h1>
<p>To debug a configuration file the following options are useful:</p>
<pre>
ps-watcher --log --nodaemon --sleep -1 --debug 2 *config-file*</pre>
<p>For even more information and control try running the above under the
perl debugger, e.g.</p>
<pre>
perl -d ps-watcher --log --nodaemon --sleep -1 --debug 2 *config-file*</pre>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>Well, some of these are not so much a bug in ps-watcher so much as a
challenge to getting ps-watcher to do what you want it to do.</p>
<p>One common problem people run in into is understanding exactly what
the process variables mean. The manual page <em>ps(1)</em> should be of
help, but I've found some of the descriptions either a bit vague or
just plain lacking.</p>
<p>Sometimes one will see this error message when debug tracing is turned on:</p>
<pre>
** debug ** Something wrong getting ps variables</pre>
<p>This just means that the process died between the time ps-watcher first
saw the existence of the process and the time that it queried
variables.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>See also <em>ps(1)</em> and <em>syslogd(8)</em>.</p>
<p>Another cool program doing ps-like things is <code>xps</code>. Well okay, it's
another program I distributed. It shows the process tree dynamically
updated using X Motif and tries to display the output ``attractively''
but fast. You can the find the homepage at
<a href="http://motif-pstree.sourceforge.net">http://motif-pstree.sourceforge.net</a> and it download via
<a href="http://prdownloads.sourceforge.net/motif-pstree?sort_by=date&sort=desc">http://prdownloads.sourceforge.net/motif-pstree</a></p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Rocky Bernstein (<a href="mailto:rocky@gnu.org">rocky@gnu.org</a>)</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<pre>
Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008
Rocky Bernstein, email: rocky@gnu.org.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.</pre>
<pre>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</pre>
<pre>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</pre>
</body>
</html>

250
install-sh Executable file
View file

@ -0,0 +1,250 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

283
missing Executable file
View file

@ -0,0 +1,283 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.3 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar ${1+"$@"} && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar ${1+"$@"} && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

40
mkinstalldirs Executable file
View file

@ -0,0 +1,40 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.1.1.1 2000/03/20 09:58:55 root Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

80
post-configure.in Executable file
View file

@ -0,0 +1,80 @@
#!@PERL@ -w
# -*- Perl -*-
# $Id: post-configure.in,v 1.11 2008/12/17 19:28:14 rockyb Exp $
require 5.006;
sub touch_file($);
$program='@PACKAGE@';
#
# Do we have a version of perl that we can work with?
#
printf "You have of Perl %s\n", $];
#
# Do we have all the packages we need?
#
print "Checking to see that you have all library modules installed...\n";
@needed_packages = ('Sys::Syslog',
# 'IPC::Open3', # -- to simultate `cmd` better
'File::Basename',
'Config::IniFiles',
'Getopt::Long',
'Pod::Text'
);
foreach $package (@needed_packages) {
unless (eval "require $package") {
die "Need package \"$package\": $@";
}
print " $package is installed\n";
}
#
#
#
print "Checking what to put after #! at the top of $program...";
$startperl = `@PERL@ -V:startperl`;
if ($startperl =~ /^startperl=\'#!(.*)\'\;$/) {
$perlpath = $1;
print "$perlpath\n";
} else {
$perlpath = '';
print STDERR "\nCan't determine what to put after #! in $program\n";
print STDERR "Change the top of the program or arrange for perl to\n";
print STDERR "execute it.\n";
}
print "Rewriting $program.in into $program...";
die "Cannot read $program.in: $!" if !open(INPUT, "<$program.in");
die "Cannot write $program: $!" if !open(OUTPUT, ">$program");
if (!$perlpath) {
print OUTPUT "# Customize this line, for example:\n#!/usr/bin/perl -w\n";
} else {
print OUTPUT "#!$perlpath -w\n";
}
@OUTPUT = <INPUT>;
shift @OUTPUT; # Remove old 1st line.
print OUTPUT @OUTPUT;
print "\n";
close(OUTPUT);
chmod 0755, $program;
# Touch a timestamp to record that we've created this $program
# from $program.in. If we later modify $program (which is convenient
# during debugging), we will know to copy that back to $program.in,
# the version that get's checked into CVS.
touch_file("./${program}.stamp");
exit;
sub touch_file($) {
my $file_name = $_[0];
if (-e $file_name) {
my $now = time();
my $count = utime $now, $now, $file_name;
exit ($count != 1);
} else {
open(FILE, ">${file_name}") || die "Can't open $file_name: $!";
close(FILE);
exit $?;
}
}

1300
ps-watcher Executable file

File diff suppressed because it is too large Load diff

1280
ps-watcher.in.in Executable file

File diff suppressed because it is too large Load diff

10
samples/README Normal file
View file

@ -0,0 +1,10 @@
sample.ini - you can use this as a template to make other configuration
files. It has lots of comments at the beginning to remind
you of what's allowed
sample2.ini - sample configuration file to alert when more than 10%
of a processes is in use.
solaris.ini - System processes that you might want to check on, customized
for Solaris. Checks that cron and syslogd are running,
and that no process uses more than 70% of the available CPU.
$Id: README,v 1.2 2000/04/09 20:40:43 rocky Exp $

13
samples/port-watch.ini Normal file
View file

@ -0,0 +1,13 @@
# $Id: port-watch.ini,v 1.1 2004/09/07 13:51:08 rockyb Exp $
# Here is an example to show how to use ps-watcher to do something
# not really possible from ps: check to see if a *port* is active.
# We make use of lsof to check port 3333 and the $PROLOG make
# sure it runs.
[$PROLOG]
occurs = first
trigger = { \$x=`lsof -i :3333 >/dev/null 2>&1`; \$? >> 8 }
action = <<EOT
put-your-favorite-command-here arg1 arg2 ...
EOT

19
samples/root-procs.ini Normal file
View file

@ -0,0 +1,19 @@
# $Id: root-procs.ini,v 1.1 2008/12/25 17:01:50 rockyb Exp $
# Test perl-action, prolog and epilog
# Rather the name of the interpreter is listed (e.g. bash or perl)
# Here's how you can match against a script.
# Look for my processes: ps-watcher.
[$PROLOG]
perl-action = $my_count=0; $root_procs=0;
[.*]
perl-action = <<EOP
if ($uid == 0) {
$root_procs++;
}
EOP
occurs = every
[$EPILOG]
perl-action = <<EOP1
system("logger You have $root_procs root processes running");
EOP1

54
samples/sample.ini Normal file
View file

@ -0,0 +1,54 @@
# $Id: sample.ini,v 1.8 2003/03/04 02:53:48 rockyb Exp $
# Comments start with # or ; and go to the end of the line.
# The format for each entry is in Microsoft .INI form:
# [process-pattern]
# trigger = perl-expression
# occurs = (every|first|none)
# action = program-and-arguments-to-run
# "trigger" and "occurs" are optional.
# Are there enough (at least 4) httpd processes running?
[httpd$]
trigger = $count < 4
action = echo "$trigger fired -- You have $count $command sessions."
# Show how many processes are running. Use builtin $count
# variable
[.]
action = echo "You have $count processes running"
# The below is implied
#occurs=first
# Which processes have been running for more than 1 day?
# Note this hack to specify a pattern ostensibly different from
# the above pattern. This is an IniConf-imposed limitation.
# Also note use of builtin-function elapsed2secs
# and builtin constant DAYS.
# The variable $etime (elapsed time) does not exist on your OS.
# For on FreeBSD it doesn't, but that has a "cputime" reports a time
# entry.
[.?]
trigger = elapsed2secs('$etime') > 1*DAYS
action = echo "$command has been running more than 1 day ($etime)"
occurs = every
[^]
trigger = $vsz > 8000
occurs = every
action = echo "Large program $command (pid $pid) matches /$ps_pat/: $vsz KB"
# Scripts don't show as the script name as the command name on some
# operating systems. Rather the name of the interpreter is listed
# (e.g. bash or perl) Here's how you can match against a script. Note
# escaping $ in the trigger but not the action.
# Note: BSD/OS on the other hand give the script name rather than the
# interpreter name.
[/usr/bin/perl]
trigger = \$args !~ /ps-watcher/
occurs = every
action = echo "***found perl program ${pid}:\n $args"

4
samples/sample2.ini Normal file
View file

@ -0,0 +1,4 @@
[.]
trigger = $pcpu > 10
action = echo "$command using $pcpu% CPU" | /bin/mail root

18
samples/solaris.ini Normal file
View file

@ -0,0 +1,18 @@
# $Id: solaris.ini,v 1.3 2000/04/09 20:40:21 rocky Exp $
# Processes one might want to monitor under Solaris
[(/usr/sbin/)?cron]
trigger = $count=1
action = echo "$command not running" | /usr/ucb/mail -s "$command down" root
[(/usr/sbin/)?sylogd]
trigger = $count=1
action = echo "$command not running" | /usr/ucb/mail -s "$command down" root
[.]
trigger = $pcpu > 70
occurs = every
action = <<EOT
echo "$command used $pcpu% CPU" | /usr/ucb/mail -s "$command was a hog" root
kill -TERM $pid
EOT

9
tests/01.pod.t Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/perl -w -T -*- Perl -*-
# $Id: 01.pod.t.in,v 1.1 2006/03/09 17:37:31 rockyb Exp $
my $top_builddir = $ENV{top_builddir} ? $ENV{top_builddir} : '..';
use Test::More;
use File::Spec::Functions;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok(catfile($top_builddir, "ps-watcher"));

9
tests/01.pod.t.in Normal file
View file

@ -0,0 +1,9 @@
#!@PERL@ -w -T -*- Perl -*-
# $Id: 01.pod.t.in,v 1.1 2006/03/09 17:37:31 rockyb Exp $
my $top_builddir = $ENV{top_builddir} ? $ENV{top_builddir} : '..';
use Test::More;
use File::Spec::Functions;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok(catfile($top_builddir, "@PACKAGE@"));

38
tests/Makefile.am Normal file
View file

@ -0,0 +1,38 @@
##############################################################################
# $Id: Makefile.am,v 1.9 2006/03/09 17:37:31 rockyb Exp $
# Copyright (C) 2003, 2004, 2006 Rocky Bernstein <rocky@cpan.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
MOSTLYCLEANFILES = *~
# The keeps automake from substituting PS_VARS
PS_VARS = ''
check_SCRIPTS = 01.pod.t args.t basic.t count.t full.t paction.t
check_DATA = args.cnf basic.cnf \
count.cnf full.cnf paction.cnf
EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \
01.pod.t.in args.t.in basic.cnf.in count.t.in driver
all:
check: test
test:
srcdir=$(srcdir); export srcdir; \
$(PERL) $(srcdir)/driver

351
tests/Makefile.in Normal file
View file

@ -0,0 +1,351 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
##############################################################################
# $Id: Makefile.am,v 1.9 2006/03/09 17:37:31 rockyb Exp $
# Copyright (C) 2003, 2004, 2006 Rocky Bernstein <rocky@cpan.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tests
DIST_COMMON = $(srcdir)/01.pod.t.in $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/args.t.in \
$(srcdir)/basic.cnf.in $(srcdir)/basic.t.in \
$(srcdir)/count.t.in $(srcdir)/full.t.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = 01.pod.t args.t basic.t count.t full.t basic.cnf
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CVS2CL = @CVS2CL@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PS = @PS@
PS_ARGS = @PS_ARGS@
PS_ARGS_FMT = @PS_ARGS_FMT@
PS_CAN_RETURN_MULTIPLE_LINES = @PS_CAN_RETURN_MULTIPLE_LINES@
PS_CUSTOM_HEADER = @PS_CUSTOM_HEADER@
PS_FULLCMD_FMT = @PS_FULLCMD_FMT@
PS_NO_NULL_HEADER = @PS_NO_NULL_HEADER@
PS_PID_OPTS = @PS_PID_OPTS@
PS_TIME_VAR = @PS_TIME_VAR@
# The keeps automake from substituting PS_VARS
PS_VARS = ''
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MOSTLYCLEANFILES = *~
check_SCRIPTS = 01.pod.t args.t basic.t count.t full.t paction.t
check_DATA = args.cnf basic.cnf \
count.cnf full.cnf paction.cnf
EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \
01.pod.t.in args.t.in basic.cnf.in count.t.in driver
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
01.pod.t: $(top_builddir)/config.status $(srcdir)/01.pod.t.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
args.t: $(top_builddir)/config.status $(srcdir)/args.t.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
basic.t: $(top_builddir)/config.status $(srcdir)/basic.t.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
count.t: $(top_builddir)/config.status $(srcdir)/count.t.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
full.t: $(top_builddir)/config.status $(srcdir)/full.t.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
basic.cnf: $(top_builddir)/config.status $(srcdir)/basic.cnf.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) $(check_DATA)
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
all:
check: test
test:
srcdir=$(srcdir); export srcdir; \
$(PERL) $(srcdir)/driver
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

13
tests/args.cnf Normal file
View file

@ -0,0 +1,13 @@
# Scripts on some OS's don't show as the script name as the command name.
# Rather the name of the interpreter is listed (e.g. bash or perl)
# Here's how you can match against a script.
# Look for my processes: ps-watcher.
[perl]
trigger = \$args =~ /ps-watcher --log/
action = echo "ok 1"
occurs = every
# On BSD/OS the name of the script rather than the interpreter is show.
[ps-watcher]
trigger = \$args =~ /ps-watcher --log/
action = echo "ok 1"
occurs = every

38
tests/args.t Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/perl -w
# $Id: args.t.in,v 1.8 2006/03/10 13:12:36 rockyb Exp $
# Arg checks
use strict;
use Test::More;
use Config;
if ('cygwin' eq $Config{osname}) {
plan( skip_all => "cygwin's ps is not powerful enough this test");
exit 0;
}
plan( tests => 2);
my $test='args';
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my $cmd = "/usr/bin/perl ../ps-watcher --log --nosyslog --nodaemon "
. " --sleep -1 --config ${srcdir}/$test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $count=0;
foreach (@output) {
if (/^.+:\s+.*ok/) {
s/.+:\s+//;
ok(1, "Saw first matching process");
$count++;
last;
}
}
ok($count>0, "Saw more than one matching process");
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

38
tests/args.t.in Normal file
View file

@ -0,0 +1,38 @@
#!@PERL@ -w
# $Id: args.t.in,v 1.8 2006/03/10 13:12:36 rockyb Exp $
# Arg checks
use strict;
use Test::More;
use Config;
if ('cygwin' eq $Config{osname}) {
plan( skip_all => "cygwin's ps is not powerful enough this test");
exit 0;
}
plan( tests => 2);
my $test='args';
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my $cmd = "@PERL@ ../ps-watcher --log --nosyslog --nodaemon "
. " --sleep -1 --config ${srcdir}/$test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $count=0;
foreach (@output) {
if (/^.+:\s+.*ok/) {
s/.+:\s+//;
ok(1, "Saw first matching process");
$count++;
last;
}
}
ok($count>0, "Saw more than one matching process");
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

27
tests/basic.cnf Normal file
View file

@ -0,0 +1,27 @@
# $Id: basic.cnf.in,v 1.4 2005/04/04 23:50:58 rockyb Exp $
# We gotta have at least two processes running. Like the OS
# and the ps-watcher program
[.]
trigger = $count > 1
action = echo "ok 1"
occurs = first
# Look for my processes
[perl]
action = echo "ok 2" || echo "$ps_pat"
[.?]
trigger = elapsed2secs('$etime') >= 0
action = echo "ok 3"
occurs = first
# I'm assuming there is no process with just a single space.
[^ $]
action = echo "ok 4"
occurs = none
# Test to see if first-trigger works.
[.*]
trigger = $pid == $$
action = echo "ok 5"
occurs = first-trigger

27
tests/basic.cnf.in Normal file
View file

@ -0,0 +1,27 @@
# $Id: basic.cnf.in,v 1.4 2005/04/04 23:50:58 rockyb Exp $
# We gotta have at least two processes running. Like the OS
# and the ps-watcher program
[.]
trigger = $count > 1
action = echo "ok 1"
occurs = first
# Look for my processes
[perl]
action = echo "ok 2" || echo "$ps_pat"
[.?]
trigger = elapsed2secs('$@PS_TIME_VAR@') >= 0
action = echo "ok 3"
occurs = first
# I'm assuming there is no process with just a single space.
[^ $]
action = echo "ok 4"
occurs = none
# Test to see if first-trigger works.
[.*]
trigger = $pid == $$
action = echo "ok 5"
occurs = first-trigger

32
tests/basic.t Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/perl -w
# $Id: basic.t.in,v 1.8 2006/03/10 19:07:06 rockyb Exp $
# Some basic checks
use strict;
use Test::More;
if ( 'etime' ) {
plan( tests => 5);
} else {
plan( tests => 4 );
}
my $test='basic';
my $cmd = "/usr/bin/perl ../ps-watcher --log --nosyslog --nodaemon "
. "--sleep -1 --config $test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $i=1;
foreach (@output) {
s/.+:\s+//;
$i++ if (!'etime' && $i==3);
my $result = sprintf "ok %d", $i;
$i++;
ok($_ =~ m{$result});
}
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

32
tests/basic.t.in Executable file
View file

@ -0,0 +1,32 @@
#!@PERL@ -w
# $Id: basic.t.in,v 1.8 2006/03/10 19:07:06 rockyb Exp $
# Some basic checks
use strict;
use Test::More;
if ( '@PS_TIME_VAR@' ) {
plan( tests => 5);
} else {
plan( tests => 4 );
}
my $test='basic';
my $cmd = "@PERL@ ../ps-watcher --log --nosyslog --nodaemon "
. "--sleep -1 --config $test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $i=1;
foreach (@output) {
s/.+:\s+//;
$i++ if (!'@PS_TIME_VAR@' && $i==3);
my $result = sprintf "ok %d", $i;
$i++;
ok($_ =~ m{$result});
}
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

12
tests/count.cnf Normal file
View file

@ -0,0 +1,12 @@
# $Id: count.cnf,v 1.1 2002/02/06 04:10:54 rocky Exp $
# Test of count and none parameters
# I'm assuming there can't be a processes with $ in the name
[fuxaduxa$]
occurs = none
action = echo "ok 1"
# Look for my processes so there should be at least one.
[perl]
occurs = none
action = echo "not ok 2"

24
tests/count.t Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/perl -w
# $Id: count.t.in,v 1.5 2006/03/10 13:12:36 rockyb Exp $
# Some count checks
use strict;
my $test='count';
print "1..2\n";
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my @output = `/usr/bin/perl ../ps-watcher --log --sleep -1 --nodaemon --config ${srcdir}/$test.cnf 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $count = @output;
foreach (@output) {
s/.+:\s+//;
print $_;
}
print "ok 2\n" unless $count == 2;
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

24
tests/count.t.in Normal file
View file

@ -0,0 +1,24 @@
#!@PERL@ -w
# $Id: count.t.in,v 1.5 2006/03/10 13:12:36 rockyb Exp $
# Some count checks
use strict;
my $test='count';
print "1..2\n";
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my @output = `@PERL@ ../ps-watcher --log --sleep -1 --nodaemon --config ${srcdir}/$test.cnf 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $count = @output;
foreach (@output) {
s/.+:\s+//;
print $_;
}
print "ok 2\n" unless $count == 2;
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

48
tests/driver Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/perl -w
#$Id: driver,v 1.1 2000/03/27 01:53:24 rocky Exp $
use strict;
use File::Basename;
my $program = basename($0); # Who am I today, anyway?
sub usage {
print "
usage:
$program [test1 ... ]
$program --help
Runs regresion tests (via Test::Harness).
If no tests are specified all tests that match *.t in the
test directory are run.
$program --help prints this help.
";
exit 100;
}
use Test::Harness qw(&runtests $verbose);
my $setup = 0;
process_options();
@ARGV = glob("*.t") if !@ARGV;
runtests @ARGV;
exit 0;
# The bane of programming.
sub process_options {
use Getopt::Long;
$Getopt::Long::autoabbrev = 1;
my $help = 0;
my $result = &GetOptions
(
'help' => \$help,
);
usage unless $result;
usage if $help;
}

15
tests/full.cnf Normal file
View file

@ -0,0 +1,15 @@
# $Id: full.cnf,v 1.3 2006/03/10 12:47:37 rockyb Exp $
# Test to see we can match on all of the processes, not
# just the ones for our account.
# On a Unix-like system where there always is a pid 1 - init.
# On there is a ppid of 1.
[.]
occurs = first-trigger
trigger = $ppid == 1
action = echo "ok 1"
[.?]
occurs = every
trigger = $pid == 1
action = echo "ok 2"

34
tests/full.t Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/perl -w
# $Id: full.t.in,v 1.6 2006/03/10 13:12:36 rockyb Exp $
# Some count checks
use strict;
use Test::More;
use Config;
if ('cygwin' eq $Config{osname}) {
plan( tests => 1);
} else {
plan( tests => 2);
}
my $test='full';
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my @output = `/usr/bin/perl ../ps-watcher --log --sleep -1 --nodaemon --config ${srcdir}/$test.cnf 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $i=1;
foreach (@output) {
if (/^.+:\s+.*ok/) {
s/.+:\s+//;
my $result = sprintf "ok %d", $i;
$i++;
ok($_ =~ m{$result});
}
}
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

34
tests/full.t.in Normal file
View file

@ -0,0 +1,34 @@
#!@PERL@ -w
# $Id: full.t.in,v 1.6 2006/03/10 13:12:36 rockyb Exp $
# Some count checks
use strict;
use Test::More;
use Config;
if ('cygwin' eq $Config{osname}) {
plan( tests => 1);
} else {
plan( tests => 2);
}
my $test='full';
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my @output = `@PERL@ ../ps-watcher --log --sleep -1 --nodaemon --config ${srcdir}/$test.cnf 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $i=1;
foreach (@output) {
if (/^.+:\s+.*ok/) {
s/.+:\s+//;
my $result = sprintf "ok %d", $i;
$i++;
ok($_ =~ m{$result});
}
}
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

21
tests/paction.cnf Normal file
View file

@ -0,0 +1,21 @@
# $Id: paction.cnf,v 1.2 2008/12/25 16:42:49 rockyb Exp $
# Test perl-action, prolog and epilog
# Rather the name of the interpreter is listed (e.g. bash or perl)
# Here's how you can match against a script.
# Look for my processes: ps-watcher.
[$PROLOG]
perl-action = $my_count=0; $root_procs=0;
[.*]
perl-action = <<EOP
if ($uid == 0) {
$my_count++; $root_procs++;
}
EOP
occurs = every
[$EPILOG]
trigger = <<EOT
$my_count > 0 && $my_count < $count &&
$root_procs > 0 && $my_count >= $root_procs
EOT
action = echo "ok 1"

37
tests/paction.t Normal file
View file

@ -0,0 +1,37 @@
#!/usr/bin/perl -w
# $Id: paction.t,v 1.2 2006/03/10 03:21:12 rockyb Exp $
# Arg paction-statement
use strict;
use Test::More;
use Config;
if ('cygwin' eq $Config{osname}) {
plan( skip_all => "cygwin's ps is not powerful enough this test");
exit 0;
}
my $test='paction';
print "1..2\n";
my $srcdir = $ENV{srcdir} ? $ENV{srcdir} : '.';
my $cmd = "../ps-watcher --log --nosyslog --nodaemon "
. " --sleep -1 --config ${srcdir}/$test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $count=0;
foreach (@output) {
if (/^.+:\s+.*ok/) {
s/.+:\s+//;
print $_;
$count++;
last;
}
}
print "ok 2\n" if $count>0;
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***

42
touch.pl Executable file
View file

@ -0,0 +1,42 @@
#!/usr/bin/perl -w
my $vcid='$Id: touch.pl,v 1.4 2006/03/08 19:22:41 rockyb Exp $ ';
# Copyright (C) 1997-2006 R. Bernstein email: rocky@cpan.org
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
use strict;
use File::Basename;
my $program = basename($0); # Who am I today, anyway?
if (@ARGV != 1) {
print "
usage:
$program *file*
A perl implimentation of a minimal Unix touch command: creates file *file*
if it does not exist. In either case, the file is given a creation
time of the current time.
";
exit 100;
}
print "$ARGV[0]\n";
if (-e $ARGV[0]) {
my $now = time();
my $count = utime $now, $now, $ARGV[0];
exit ($count != 1);
} else {
open(FILE, ">$ARGV[0]") || die "Can't open $ARGV[0]: $!";
close(FILE);
exit $?;
}