Imported Upstream version 1.08

This commit is contained in:
Jan Wagner 2013-11-06 09:53:41 +01:00
parent a8f50c0a7c
commit 49403a9b26
9 changed files with 338 additions and 184 deletions

265
ChangeLog
View file

@ -2,90 +2,119 @@
## autogenerated ChangeLog -- don't edit ## autogenerated ChangeLog -- don't edit
## ##
2008-12-25 Thursday 17:01 Rocky Bernstein <rocky@cpan.org> 2009-02-19 Thursday 17:00 Rocky Bernstein <rocky@gnu.org>
* configure.ac: We're in 1.08 now
2009-02-19 Thursday 16:57 Rocky Bernstein <rocky@gnu.org>
* THANKS, ps-watcher.in.in: pidfile support from Jan Wagner and
friends
2008-12-31 Wednesday 11:25 Rocky Bernstein <rocky@gnu.org>
* home-page/: index.html: Presumably a little more compliant
2008-12-31 Wednesday 11:17 Rocky Bernstein <rocky@gnu.org>
* home-page/index.html: Convert to use css
2008-12-25 Thursday 17:34 Rocky Bernstein <rocky@gnu.org>
* .cvsignore: This time, for sure!
2008-12-25 Thursday 17:33 Rocky Bernstein <rocky@gnu.org>
* cvs2cl_usermap: More administrivia
2008-12-25 Thursday 17:31 Rocky Bernstein <rocky@gnu.org>
* .cvsignore: Administrivia
2008-12-25 Thursday 17:01 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, samples/root-procs.ini: Add sample code using * Makefile.am, samples/root-procs.ini: Add sample code using
perl-action. perl-action.
2008-12-25 Thursday 16:42 Rocky Bernstein <rocky@cpan.org> 2008-12-25 Thursday 16:42 Rocky Bernstein <rocky@gnu.org>
* configure.ac, tests/paction.cnf: More Darwin9 fixes: tty can be * configure.ac, tests/paction.cnf: More Darwin9 fixes: tty can be
many token so put at end of parsing. many token so put at end of parsing.
2008-12-25 Thursday 16:39 Rocky Bernstein <rocky@cpan.org> 2008-12-25 Thursday 16:39 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, NEWS, configure.ac: Get ready for 1.07 release * Makefile.am, NEWS, configure.ac: Get ready for 1.07 release
2008-12-23 Tuesday 11:09 Rocky Bernstein <rocky@cpan.org> 2008-12-23 Tuesday 11:09 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Typo: svz -> vsz. Thanks to Oliver Guerrier for * ps-watcher.in.in: Typo: svz -> vsz. Thanks to Oliver Guerrier for
pointing out. pointing out.
2008-12-18 Thursday 01:07 Rocky Bernstein <rocky@cpan.org> 2008-12-18 Thursday 01:07 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Bug in duplicating log * ps-watcher.in.in: Bug in duplicating log
2008-12-17 Wednesday 20:08 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 20:08 Rocky Bernstein <rocky@gnu.org>
* ANNOUNCE, AUTHORS, configure.ac: test cygwin and NetBSD and * ANNOUNCE, AUTHORS, configure.ac: test cygwin and NetBSD and
update contact info update contact info
2008-12-17 Wednesday 19:28 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 19:28 Rocky Bernstein <rocky@gnu.org>
* post-configure.in: Tolerate older Perl's enough to warn that we * post-configure.in: Tolerate older Perl's enough to warn that we
can't use them. can't use them.
2008-12-17 Wednesday 18:31 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 18:31 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Linux newline nuke fixes along the lines of the * configure.ac: Linux newline nuke fixes along the lines of the
Darwin code Darwin code
2008-12-17 Wednesday 17:06 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 17:06 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in: Better about dealing with * configure.ac, ps-watcher.in.in: Better about dealing with
unwritable log file unwritable log file
2008-12-17 Wednesday 16:31 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 16:31 Rocky Bernstein <rocky@gnu.org>
* configure.ac: In 1.07 now * configure.ac: In 1.07 now
2008-12-17 Wednesday 16:27 Rocky Bernstein <rocky@cpan.org> 2008-12-17 Wednesday 16:27 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Changes for Darwin9 * configure.ac: Changes for Darwin9
2006-11-17 Friday 14:02 Rocky Bernstein <rocky@cpan.org> 2006-11-17 Friday 14:02 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in, home-page/index.html: Small typos. * ps-watcher.in.in, home-page/index.html: Small typos.
2006-09-21 Thursday 23:07 Rocky Bernstein <rocky@cpan.org> 2006-09-21 Thursday 23:07 Rocky Bernstein <rocky@gnu.org>
* home-page/index.html: Correct for new sf link * home-page/index.html: Correct for new sf link
2006-03-11 Saturday 03:16 Rocky Bernstein <rocky@cpan.org> 2006-03-11 Saturday 03:16 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: More doc changes * ps-watcher.in.in: More doc changes
2006-03-10 Friday 19:33 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 19:33 Rocky Bernstein <rocky@gnu.org>
* NEWS: Last change before release * NEWS: Last change before release
2006-03-10 Friday 19:07 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 19:07 Rocky Bernstein <rocky@gnu.org>
* configure.ac, post-configure.in, ps-watcher.in.in, * configure.ac, post-configure.in, ps-watcher.in.in,
tests/basic.t.in: Deal with time on netbsdelf and regression tests/basic.t.in: Deal with time on netbsdelf and regression
tests. basic.t.in: generalize time handling - not just cygwin. tests. basic.t.in: generalize time handling - not just cygwin.
post-configure.in configure.ac: clean up a little. post-configure.in configure.ac: clean up a little.
2006-03-10 Friday 13:12 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 13:12 Rocky Bernstein <rocky@gnu.org>
* tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Run * tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Run
ps-watcher in tests with configured Perl location. ps-watcher in tests with configured Perl location.
2006-03-10 Friday 12:47 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 12:47 Rocky Bernstein <rocky@gnu.org>
* tests/: full.cnf, full.t.in: Add a test and adjust for cygwin. * tests/: full.cnf, full.t.in: Add a test and adjust for cygwin.
2006-03-10 Friday 12:26 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 12:26 Rocky Bernstein <rocky@gnu.org>
* configure.ac, post-configure.in, ps-watcher.in.in, * configure.ac, post-configure.in, ps-watcher.in.in,
tests/basic.t.in: Changes to make this work on more tests/basic.t.in: Changes to make this work on more
@ -93,56 +122,56 @@
to get invocation work eveywhere basic.t.in: test for cputime; to get invocation work eveywhere basic.t.in: test for cputime;
forgot ! forgot !
2006-03-10 Friday 04:51 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 04:51 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Darwin 8 is okay * configure.ac: Darwin 8 is okay
2006-03-10 Friday 04:50 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 04:50 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Bug in running right Perl in post-configure * configure.ac: Bug in running right Perl in post-configure
2006-03-10 Friday 03:49 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 03:49 Rocky Bernstein <rocky@gnu.org>
* configure.ac, post-configure.in: Use PERL value specified more. * configure.ac, post-configure.in: Use PERL value specified more.
2006-03-10 Friday 03:39 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 03:39 Rocky Bernstein <rocky@gnu.org>
* NEWS, configure.ac: Add configure option to specify Perl location * NEWS, configure.ac: Add configure option to specify Perl location
2006-03-10 Friday 03:24 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 03:24 Rocky Bernstein <rocky@gnu.org>
* tests/args.t.in: typo: it's ok not okay. * tests/args.t.in: typo: it's ok not okay.
2006-03-10 Friday 03:21 Rocky Bernstein <rocky@cpan.org> 2006-03-10 Friday 03:21 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, tests/args.t.in, * configure.ac, ps-watcher.in.in, tests/args.t.in,
tests/basic.t.in, tests/full.t.in, tests/paction.t: Add minimal tests/basic.t.in, tests/full.t.in, tests/paction.t: Add minimal
cygwin support cygwin support
2006-03-09 Thursday 17:37 Rocky Bernstein <rocky@cpan.org> 2006-03-09 Thursday 17:37 Rocky Bernstein <rocky@gnu.org>
* configure.ac, post-configure.in, tests/01.pod.t.in, * configure.ac, post-configure.in, tests/01.pod.t.in,
tests/Makefile.am: 01.pod.t.in: add POD testing routine tests/Makefile.am: 01.pod.t.in: add POD testing routine
configure.ac: do chmod +x on perl-substituted files. configure.ac: do chmod +x on perl-substituted files.
2006-03-09 Thursday 16:46 Rocky Bernstein <rocky@cpan.org> 2006-03-09 Thursday 16:46 Rocky Bernstein <rocky@gnu.org>
* NEWS, ps-watcher.in.in: Document security better. * NEWS, ps-watcher.in.in: Document security better.
2006-03-08 Wednesday 22:52 Rocky Bernstein <rocky@cpan.org> 2006-03-08 Wednesday 22:52 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, home-page/index.html: Get ready * configure.ac, ps-watcher.in.in, home-page/index.html: Get ready
for 1.06 release. for 1.06 release.
2006-03-08 Wednesday 22:24 Rocky Bernstein <rocky@cpan.org> 2006-03-08 Wednesday 22:24 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Correction in getting signal name. * ps-watcher.in.in: Correction in getting signal name.
2006-03-08 Wednesday 19:21 Rocky Bernstein <rocky@cpan.org> 2006-03-08 Wednesday 19:21 Rocky Bernstein <rocky@gnu.org>
* touch.pl: Reinstate since Makefile.am uses. * touch.pl: Reinstate since Makefile.am uses.
2006-03-08 Wednesday 19:15 Rocky Bernstein <rocky@cpan.org> 2006-03-08 Wednesday 19:15 Rocky Bernstein <rocky@gnu.org>
* AUTHORS, Makefile.am, cvs2cl_usermap, post-configure.in, * AUTHORS, Makefile.am, cvs2cl_usermap, post-configure.in,
ps-watcher.in.in, touch.pl: ps-watcher.in.in: Wasn't terminating ps-watcher.in.in, touch.pl: ps-watcher.in.in: Wasn't terminating
@ -152,11 +181,11 @@
*: rocky@panix.com -> rocky@cpan.org touch.pl: now handled inside *: rocky@panix.com -> rocky@cpan.org touch.pl: now handled inside
post-configure by Perl post-configure by Perl
2006-02-03 Friday 02:23 Rocky Bernstein <rocky@cpan.org> 2006-02-03 Friday 02:23 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: One more small typo. * ps-watcher.in.in: One more small typo.
2006-02-03 Friday 02:15 Rocky Bernstein <rocky@cpan.org> 2006-02-03 Friday 02:15 Rocky Bernstein <rocky@gnu.org>
* post-configure.in, ps-watcher.in.in, home-page/index.html: Mostly * post-configure.in, ps-watcher.in.in, home-page/index.html: Mostly
small changes: small changes:
@ -169,41 +198,41 @@
home-page/index.html: Probably remove a W3C error. home-page/index.html: Probably remove a W3C error.
2006-01-17 Tuesday 10:00 Rocky Bernstein <rocky@cpan.org> 2006-01-17 Tuesday 10:00 Rocky Bernstein <rocky@gnu.org>
* home-page/index.html: Make valid HTML as per W3C. * home-page/index.html: Make valid HTML as per W3C.
2005-10-12 Wednesday 01:14 Rocky Bernstein <rocky@cpan.org> 2005-10-12 Wednesday 01:14 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in, NEWS: Add BUGS section to manual to describe * ps-watcher.in.in, NEWS: Add BUGS section to manual to describe
common problems. common problems.
2005-09-12 Monday 17:03 Rocky Bernstein <rocky@cpan.org> 2005-09-12 Monday 17:03 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Now in 1.06cvs territory * configure.ac: Now in 1.06cvs territory
2005-09-12 Monday 17:03 Rocky Bernstein <rocky@cpan.org> 2005-09-12 Monday 17:03 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Guard against uninitialized variables * ps-watcher.in.in: Guard against uninitialized variables
2005-06-22 Wednesday 01:59 Rocky Bernstein <rocky@cpan.org> 2005-06-22 Wednesday 01:59 Rocky Bernstein <rocky@gnu.org>
* home-page/index.html: <Code> instead of <kbd>? * home-page/index.html: <Code> instead of <kbd>?
2005-06-22 Wednesday 01:57 Rocky Bernstein <rocky@cpan.org> 2005-06-22 Wednesday 01:57 Rocky Bernstein <rocky@gnu.org>
* home-page/index.html: Correct grammar courtesy of Sir Monitor * home-page/index.html: Correct grammar courtesy of Sir Monitor
Lizard, Ph. Mad. Lizard, Ph. Mad.
2005-05-17 Tuesday 22:00 Rocky Bernstein <rocky@cpan.org> 2005-05-17 Tuesday 22:00 Rocky Bernstein <rocky@gnu.org>
* NEWS: What's new. * NEWS: What's new.
2005-05-17 Tuesday 09:56 Rocky Bernstein <rocky@cpan.org> 2005-05-17 Tuesday 09:56 Rocky Bernstein <rocky@gnu.org>
* configure.ac: NetBSD works like FreeBSD * configure.ac: NetBSD works like FreeBSD
2005-05-17 Tuesday 09:52 Rocky Bernstein <rocky@cpan.org> 2005-05-17 Tuesday 09:52 Rocky Bernstein <rocky@gnu.org>
* COPYING, Makefile.am, NEWS, config.guess, config.sub, * COPYING, Makefile.am, NEWS, config.guess, config.sub,
configure.ac, missing, post-configure.in, docs/Makefile.am, configure.ac, missing, post-configure.in, docs/Makefile.am,
@ -212,45 +241,45 @@
GPL address change. GPL address change.
2005-04-09 Saturday 18:06 Rocky Bernstein <rocky@cpan.org> 2005-04-09 Saturday 18:06 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Like this a tad better. * ps-watcher.in.in: Like this a tad better.
2005-04-04 Monday 23:58 Rocky Bernstein <rocky@cpan.org> 2005-04-04 Monday 23:58 Rocky Bernstein <rocky@gnu.org>
* NEWS, ps-watcher.in.in: Note recent change. * NEWS, ps-watcher.in.in: Note recent change.
2005-04-04 Monday 23:53 Rocky Bernstein <rocky@cpan.org> 2005-04-04 Monday 23:53 Rocky Bernstein <rocky@gnu.org>
* THANKS: Add thanks to Iñaki Sánchez. * THANKS: Add thanks to Iñaki Sánchez.
2005-04-04 Monday 23:50 Rocky Bernstein <rocky@cpan.org> 2005-04-04 Monday 23:50 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in, tests/basic.cnf.in: Allow $ps_pat to be used in * 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 action. Patch courtesy of Iñaki Sánchez. (i s a n c h e z at
unav dot es) unav dot es)
2004-09-11 Saturday 13:29 Rocky Bernstein <rocky@cpan.org> 2004-09-11 Saturday 13:29 Rocky Bernstein <rocky@gnu.org>
* docs/.cvsignore: More pod2htm stuff. * docs/.cvsignore: More pod2htm stuff.
2004-09-09 Thursday 10:58 Rocky Bernstein <rocky@cpan.org> 2004-09-09 Thursday 10:58 Rocky Bernstein <rocky@gnu.org>
* NEWS, cvs2cl_header, cvs2cl_usermap: ChangeLog-creation * NEWS, cvs2cl_header, cvs2cl_usermap: ChangeLog-creation
improvements. improvements.
2004-09-07 Tuesday 13:51 Rocky Bernstein <rocky@cpan.org> 2004-09-07 Tuesday 13:51 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, ps-watcher.in.in, docs/Makefile.am, * Makefile.am, ps-watcher.in.in, docs/Makefile.am,
samples/port-watch.ini: Make distcheck works. Show how to use 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 $PROLOG to do a no-ps like thing such as watching a port (via
lsof). lsof).
2004-05-26 Wednesday 13:46 Rocky Bernstein <rocky@cpan.org> 2004-05-26 Wednesday 13:46 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Small change. * ps-watcher.in.in: Small change.
2004-05-26 Wednesday 13:42 Rocky Bernstein <rocky@cpan.org> 2004-05-26 Wednesday 13:42 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, configure.ac, ps-watcher.in.in, docs/Makefile.am: * Makefile.am, configure.ac, ps-watcher.in.in, docs/Makefile.am:
ps-watcher.in.in: smallish changes - call closelog on ps-watcher.in.in: smallish changes - call closelog on
@ -264,313 +293,313 @@
configure.ac: now in version 1.05 now. Allow maintainer mode (to configure.ac: now in version 1.05 now. Allow maintainer mode (to
create ChangeLog) create ChangeLog)
2004-02-15 Sunday 12:03 Rocky Bernstein <rocky@cpan.org> 2004-02-15 Sunday 12:03 Rocky Bernstein <rocky@gnu.org>
* docs/Makefile.am: Set title to name without the .in. * docs/Makefile.am: Set title to name without the .in.
2004-01-18 Sunday 12:20 Rocky Bernstein <rocky@cpan.org> 2004-01-18 Sunday 12:20 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Update copyright. * ps-watcher.in.in: Update copyright.
2004-01-18 Sunday 11:49 Rocky Bernstein <rocky@cpan.org> 2004-01-18 Sunday 11:49 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Improve documentation with respect to * ps-watcher.in.in: Improve documentation with respect to
perl-action. perl-action.
2004-01-15 Thursday 03:23 Rocky Bernstein <rocky@cpan.org> 2004-01-15 Thursday 03:23 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: perldoc fix. * ps-watcher.in.in: perldoc fix.
2004-01-15 Thursday 03:02 Rocky Bernstein <rocky@cpan.org> 2004-01-15 Thursday 03:02 Rocky Bernstein <rocky@gnu.org>
* tests/paction.t: Regression test for $PROLOG, $EPILOG and * tests/paction.t: Regression test for $PROLOG, $EPILOG and
perl-action. perl-action.
2004-01-15 Thursday 03:00 Rocky Bernstein <rocky@cpan.org> 2004-01-15 Thursday 03:00 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, tests/Makefile.am, * configure.ac, ps-watcher.in.in, tests/Makefile.am,
tests/paction.cnf: Add $PROLOG, $EPILOG and perl-action sections. tests/paction.cnf: Add $PROLOG, $EPILOG and perl-action sections.
Allows one to accumulate information over all processes and take Allows one to accumulate information over all processes and take
action on that. action on that.
2004-01-10 Saturday 04:39 Rocky Bernstein <rocky@cpan.org> 2004-01-10 Saturday 04:39 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Documentation enhancement, I think. * ps-watcher.in.in: Documentation enhancement, I think.
2003-11-22 Saturday 12:31 Rocky Bernstein <rocky@cpan.org> 2003-11-22 Saturday 12:31 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: And another formatting change... * ps-watcher.in.in: And another formatting change...
2003-11-22 Saturday 12:27 Rocky Bernstein <rocky@cpan.org> 2003-11-22 Saturday 12:27 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: One more trivial typo.... * ps-watcher.in.in: One more trivial typo....
2003-11-22 Saturday 12:26 Rocky Bernstein <rocky@cpan.org> 2003-11-22 Saturday 12:26 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Documentation typo. * ps-watcher.in.in: Documentation typo.
2003-11-22 Saturday 12:01 Rocky Bernstein <rocky@cpan.org> 2003-11-22 Saturday 12:01 Rocky Bernstein <rocky@gnu.org>
* NEWS, configure.ac: Get ready for new (minor) release. * NEWS, configure.ac: Get ready for new (minor) release.
2003-11-21 Friday 02:36 Rocky Bernstein <rocky@cpan.org> 2003-11-21 Friday 02:36 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in, tests/basic.cnf.in, tests/basic.t.in: Add * ps-watcher.in.in, tests/basic.cnf.in, tests/basic.t.in: Add
first-trigger feature. first-trigger feature.
2003-09-11 Thursday 03:17 Rocky Bernstein <rocky@cpan.org> 2003-09-11 Thursday 03:17 Rocky Bernstein <rocky@gnu.org>
* NEWS: Get ready for a release. * NEWS: Get ready for a release.
2003-09-10 Wednesday 07:30 Rocky Bernstein <rocky@cpan.org> 2003-09-10 Wednesday 07:30 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Fix example configuration as suggested in bug * ps-watcher.in.in: Fix example configuration as suggested in bug
#776229. #776229.
2003-09-05 Friday 00:23 Rocky Bernstein <rocky@cpan.org> 2003-09-05 Friday 00:23 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: More complicated trigger example suggested by * ps-watcher.in.in: More complicated trigger example suggested by
jason jason
2003-09-03 Wednesday 02:04 Rocky Bernstein <rocky@cpan.org> 2003-09-03 Wednesday 02:04 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Add troubleshooting section * ps-watcher.in.in: Add troubleshooting section
2003-09-03 Wednesday 01:42 Rocky Bernstein <rocky@cpan.org> 2003-09-03 Wednesday 01:42 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in: Fixes for FreeBSD * configure.ac, ps-watcher.in.in: Fixes for FreeBSD
2003-08-31 Sunday 21:22 Rocky Bernstein <rocky@cpan.org> 2003-08-31 Sunday 21:22 Rocky Bernstein <rocky@gnu.org>
* tests/basic.cnf.in: perhaps some processes use so little CPU that * tests/basic.cnf.in: perhaps some processes use so little CPU that
the elapsed time will round to zero. Deal with it. the elapsed time will round to zero. Deal with it.
2003-08-30 Saturday 20:49 Rocky Bernstein <rocky@cpan.org> 2003-08-30 Saturday 20:49 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Update date. * ps-watcher.in.in: Update date.
2003-08-29 Friday 10:49 Rocky Bernstein <rocky@cpan.org> 2003-08-29 Friday 10:49 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Get ready for another release. * configure.ac: Get ready for another release.
2003-08-29 Friday 10:48 Rocky Bernstein <rocky@cpan.org> 2003-08-29 Friday 10:48 Rocky Bernstein <rocky@gnu.org>
* tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Regression * tests/: args.t.in, basic.t.in, count.t.in, full.t.in: Regression
tests need to deal with timestamped output. tests need to deal with timestamped output.
2003-08-29 Friday 10:47 Rocky Bernstein <rocky@cpan.org> 2003-08-29 Friday 10:47 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Add syslog-like timestamp to logfile output. * ps-watcher.in.in: Add syslog-like timestamp to logfile output.
Problems with getting ps-output now appears only on debug output. Problems with getting ps-output now appears only on debug output.
2003-08-29 Friday 10:45 Rocky Bernstein <rocky@cpan.org> 2003-08-29 Friday 10:45 Rocky Bernstein <rocky@gnu.org>
* post-configure.in: Use -w (warning) on perl invocation * post-configure.in: Use -w (warning) on perl invocation
2003-08-13 Wednesday 02:33 Rocky Bernstein <rocky@cpan.org> 2003-08-13 Wednesday 02:33 Rocky Bernstein <rocky@gnu.org>
* configure.ac: PS_CAN_RETURN_MULTIPLE_LINES not set on AIX which * configure.ac: PS_CAN_RETURN_MULTIPLE_LINES not set on AIX which
broke it. broke it.
2003-07-11 Friday 05:56 Rocky Bernstein <rocky@cpan.org> 2003-07-11 Friday 05:56 Rocky Bernstein <rocky@gnu.org>
* Makefile.am: Add sample files * Makefile.am: Add sample files
2003-07-11 Friday 05:47 Rocky Bernstein <rocky@cpan.org> 2003-07-11 Friday 05:47 Rocky Bernstein <rocky@gnu.org>
* configure.ac: typo * configure.ac: typo
2003-07-11 Friday 05:46 Rocky Bernstein <rocky@cpan.org> 2003-07-11 Friday 05:46 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Get ready for 1.0 release. * configure.ac: Get ready for 1.0 release.
2003-07-11 Friday 05:43 Rocky Bernstein <rocky@cpan.org> 2003-07-11 Friday 05:43 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, tests/Makefile.am, tests/args.t.in, * Makefile.am, tests/Makefile.am, tests/args.t.in,
tests/count.t.in, tests/full.t.in: Make "make distcheck" work. tests/count.t.in, tests/full.t.in: Make "make distcheck" work.
2003-07-11 Friday 05:42 Rocky Bernstein <rocky@cpan.org> 2003-07-11 Friday 05:42 Rocky Bernstein <rocky@gnu.org>
* THANKS: Update as appropriate. * THANKS: Update as appropriate.
2003-07-10 Thursday 12:20 Rocky Bernstein <rocky@cpan.org> 2003-07-10 Thursday 12:20 Rocky Bernstein <rocky@gnu.org>
* configure.ac, post-configure.in: A tad better for making "make * configure.ac, post-configure.in: A tad better for making "make
distcheck" work: Use $srcdir in post-configure and arrange for distcheck" work: Use $srcdir in post-configure and arrange for
srcdir to be passed in. srcdir to be passed in.
2003-07-10 Thursday 11:50 Rocky Bernstein <rocky@cpan.org> 2003-07-10 Thursday 11:50 Rocky Bernstein <rocky@gnu.org>
* THANKS, TODO, config.cache, configure.ac, ps-watcher.in.in: Deal * 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 with ps (e.g. Solaris's) which return more than one line for a
single pid. single pid.
2003-07-10 Thursday 11:42 Rocky Bernstein <rocky@cpan.org> 2003-07-10 Thursday 11:42 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Stupid mistake - comments are # not /* */. * ps-watcher.in.in: Stupid mistake - comments are # not /* */.
2003-05-19 Monday 16:33 Rocky Bernstein <rocky@cpan.org> 2003-05-19 Monday 16:33 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Accomodate darwin6 * configure.ac: Accomodate darwin6
2003-05-19 Monday 16:33 Rocky Bernstein <rocky@cpan.org> 2003-05-19 Monday 16:33 Rocky Bernstein <rocky@gnu.org>
* tests/args.t.in: Add one test of --nosyslog * tests/args.t.in: Add one test of --nosyslog
2003-05-19 Monday 15:58 Rocky Bernstein <rocky@cpan.org> 2003-05-19 Monday 15:58 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Add AIX support. * configure.ac: Add AIX support.
2003-05-16 Friday 00:12 Rocky Bernstein <rocky@cpan.org> 2003-05-16 Friday 00:12 Rocky Bernstein <rocky@gnu.org>
* README: IniConf is now called Config::IniFiles * README: IniConf is now called Config::IniFiles
2003-03-06 Thursday 05:57 Rocky Bernstein <rocky@cpan.org> 2003-03-06 Thursday 05:57 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Failed full test. Need to add -x. * configure.ac: Failed full test. Need to add -x.
2003-03-06 Thursday 05:48 Rocky Bernstein <rocky@cpan.org> 2003-03-06 Thursday 05:48 Rocky Bernstein <rocky@gnu.org>
* tests/full.cnf: Don't assume first is pid 1! * tests/full.cnf: Don't assume first is pid 1!
2003-03-06 Thursday 05:37 Rocky Bernstein <rocky@cpan.org> 2003-03-06 Thursday 05:37 Rocky Bernstein <rocky@gnu.org>
* configure.ac, tests/Makefile.am, tests/.cvsignore, * configure.ac, tests/Makefile.am, tests/.cvsignore,
tests/full.cnf, tests/full.t.in: Add test that we can trigger on tests/full.cnf, tests/full.t.in: Add test that we can trigger on
watching processes other than the ones under our account. watching processes other than the ones under our account.
2003-03-06 Thursday 03:54 Rocky Bernstein <rocky@cpan.org> 2003-03-06 Thursday 03:54 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, NEWS, config.guess, configure.ac, docs/Makefile.am, * Makefile.am, NEWS, config.guess, configure.ac, docs/Makefile.am,
tests/Makefile.am: Changes for Mac OS/X tests/Makefile.am: Changes for Mac OS/X
2003-03-04 Tuesday 18:01 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 18:01 Rocky Bernstein <rocky@gnu.org>
* aclocal.m4, docs/Makefile.am, tests/Makefile.in: Add more * aclocal.m4, docs/Makefile.am, tests/Makefile.in: Add more
automake conversion idioms automake conversion idioms
2003-03-04 Tuesday 14:14 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 14:14 Rocky Bernstein <rocky@gnu.org>
* autogen.sh: Omitted running aclocal, autoconf, automake... * autogen.sh: Omitted running aclocal, autoconf, automake...
2003-03-04 Tuesday 14:08 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 14:08 Rocky Bernstein <rocky@gnu.org>
* docs/: Makefile.am, Makefile.in: More automake conversion pains. * docs/: Makefile.am, Makefile.in: More automake conversion pains.
2003-03-04 Tuesday 14:05 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 14:05 Rocky Bernstein <rocky@gnu.org>
* .cvsignore, MANIFEST: MANIFEST: not used in automake * .cvsignore, MANIFEST: MANIFEST: not used in automake
2003-03-04 Tuesday 14:03 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 14:03 Rocky Bernstein <rocky@gnu.org>
* NEWS, autogen.sh: autogen.sh: useful for CVS NEWS: what's been * NEWS, autogen.sh: autogen.sh: useful for CVS NEWS: what's been
happening? happening?
2003-03-04 Tuesday 13:59 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 13:59 Rocky Bernstein <rocky@gnu.org>
* Makefile.am, Makefile.in: More automake conversion work. * Makefile.am, Makefile.in: More automake conversion work.
Makefile.am: forgot to add Makefile.PL. Makefile.in: superceded Makefile.am: forgot to add Makefile.PL. Makefile.in: superceded
by Makfile.am by Makfile.am
2003-03-04 Tuesday 13:55 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 13:55 Rocky Bernstein <rocky@gnu.org>
* AUTHORS, Makefile.am, Makefile.in, NEWS, aclocal.m4, version, * AUTHORS, Makefile.am, Makefile.in, NEWS, aclocal.m4, version,
docs/Makefile.am, docs/Makefile.in, tests/Makefile.am, docs/Makefile.am, docs/Makefile.in, tests/Makefile.am,
tests/Makefile.in: Convert to use Makefile.am tests/Makefile.in: Convert to use Makefile.am
2003-03-04 Tuesday 02:53 Rocky Bernstein <rocky@cpan.org> 2003-03-04 Tuesday 02:53 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, version, samples/sample.ini, * configure.ac, ps-watcher.in.in, version, samples/sample.ini,
tests/args.cnf: Changes for BSD/OS. Also potentially a bug in tests/args.cnf: Changes for BSD/OS. Also potentially a bug in
FreeBSD. FreeBSD.
2003-03-02 Sunday 16:35 Rocky Bernstein <rocky@cpan.org> 2003-03-02 Sunday 16:35 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: More small document changes. Make HTML come out * ps-watcher.in.in: More small document changes. Make HTML come out
a tad better. a tad better.
2003-03-02 Sunday 15:28 Rocky Bernstein <rocky@cpan.org> 2003-03-02 Sunday 15:28 Rocky Bernstein <rocky@gnu.org>
* ps-watcher.in.in: Update link for netwinder location! * ps-watcher.in.in: Update link for netwinder location!
2003-03-01 Saturday 21:38 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:38 Rocky Bernstein <rocky@gnu.org>
* MANIFEST: Typo. * MANIFEST: Typo.
2003-03-01 Saturday 21:37 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:37 Rocky Bernstein <rocky@gnu.org>
* NEWS: What's up. * NEWS: What's up.
2003-03-01 Saturday 21:35 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:35 Rocky Bernstein <rocky@gnu.org>
* MANIFEST: Add Changelog * MANIFEST: Add Changelog
2003-03-01 Saturday 21:23 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:23 Rocky Bernstein <rocky@gnu.org>
* samples/sample.ini: Add $args example. * samples/sample.ini: Add $args example.
2003-03-01 Saturday 21:12 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:12 Rocky Bernstein <rocky@gnu.org>
* MANIFEST, configure.ac, ps-watcher.in.in: Add variables to * MANIFEST, configure.ac, ps-watcher.in.in: Add variables to
control what ps can do, e.g. can nuke header line, has custom control what ps can do, e.g. can nuke header line, has custom
title (for nuking header line), what time variable we can test title (for nuking header line), what time variable we can test
on. on.
2003-03-01 Saturday 21:09 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:09 Rocky Bernstein <rocky@gnu.org>
* tests/: .cvsignore, args.t.in, basic.cnf, basic.cnf.in: Don't * tests/: .cvsignore, args.t.in, basic.cnf, basic.cnf.in: Don't
assume etime is a ps-variable. Thanks, FreeBSD. assume etime is a ps-variable. Thanks, FreeBSD.
2003-03-01 Saturday 21:08 Rocky Bernstein <rocky@cpan.org> 2003-03-01 Saturday 21:08 Rocky Bernstein <rocky@gnu.org>
* docs/Makefile.in: Cater to brain-dead make on FreeBSD. * docs/Makefile.in: Cater to brain-dead make on FreeBSD.
2003-02-28 Friday 16:45 Rocky Bernstein <rocky@cpan.org> 2003-02-28 Friday 16:45 Rocky Bernstein <rocky@gnu.org>
* MANIFEST, configure.ac: configure.ac: add freebsd4 check * MANIFEST, configure.ac: configure.ac: add freebsd4 check
MANIFEST: add args test files MANIFEST: add args test files
2003-02-28 Friday 13:37 Rocky Bernstein <rocky@cpan.org> 2003-02-28 Friday 13:37 Rocky Bernstein <rocky@gnu.org>
* config.sub: Update with more recent version of this. * config.sub: Update with more recent version of this.
2003-02-28 Friday 12:34 Rocky Bernstein <rocky@cpan.org> 2003-02-28 Friday 12:34 Rocky Bernstein <rocky@gnu.org>
* tests/: .cvsignore, args.cnf, args.t.in: Add args regression * tests/: .cvsignore, args.cnf, args.t.in: Add args regression
test. test.
2003-02-28 Friday 12:33 Rocky Bernstein <rocky@cpan.org> 2003-02-28 Friday 12:33 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, tests/Makefile.in, * configure.ac, ps-watcher.in.in, tests/Makefile.in,
tests/basic.cnf, tests/basic.t.in, tests/count.t.in: Add args tests/basic.cnf, tests/basic.t.in, tests/count.t.in: Add args
documentation and regression tests. count.t.in, basic.t.in: set documentation and regression tests. count.t.in, basic.t.in: set
perl mode for emacs perl mode for emacs
2003-02-27 Thursday 23:46 Rocky Bernstein <rocky@cpan.org> 2003-02-27 Thursday 23:46 Rocky Bernstein <rocky@gnu.org>
* configure.ac, ps-watcher.in.in, version: Add $args variable to * configure.ac, ps-watcher.in.in, version: Add $args variable to
test on entire command. Perpare to make into another version. test on entire command. Perpare to make into another version.
2003-02-27 Thursday 21:21 Rocky Bernstein <rocky@cpan.org> 2003-02-27 Thursday 21:21 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Add args to the list of variables that are * configure.ac: Add args to the list of variables that are
accepted. accepted.
2003-01-27 Monday 22:41 Rocky Bernstein <rocky@cpan.org> 2003-01-27 Monday 22:41 Rocky Bernstein <rocky@gnu.org>
* MANIFEST, configure.stamp, version: MANIFEST: configre.in -> * MANIFEST, configure.stamp, version: MANIFEST: configre.in ->
configure.ac Other files not sure about, but we'll try configure.ac Other files not sure about, but we'll try
initially... initially...
2003-01-27 Monday 22:37 Rocky Bernstein <rocky@cpan.org> 2003-01-27 Monday 22:37 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Remove touch of stamp file. Dunno... * configure.ac: Remove touch of stamp file. Dunno...
2003-01-27 Monday 22:35 Rocky Bernstein <rocky@cpan.org> 2003-01-27 Monday 22:35 Rocky Bernstein <rocky@gnu.org>
* configure.ac: Bump version number. * configure.ac: Bump version number.
2003-01-27 Monday 22:34 Rocky Bernstein <rocky@cpan.org> 2003-01-27 Monday 22:34 Rocky Bernstein <rocky@gnu.org>
* Makefile.in, NEWS, configure.ac, configure.in, ps-watcher.in.in, * Makefile.in, NEWS, configure.ac, configure.in, ps-watcher.in.in,
samples/sample.ini: Bug in running make dist. samples/sample.ini: Bug in running make dist.

7
NEWS
View file

@ -1,3 +1,8 @@
Changes from 1.07 to 1.08 (March 15, 2009)
- pidfile support via Jan Wagner.
- Darwin9 support
Changes from 1.06 to 1.07 (December 25, 2008) Changes from 1.06 to 1.07 (December 25, 2008)
- Changed to include and tested on Darwin9 - Changed to include and tested on Darwin9
@ -93,4 +98,4 @@ Make "occurs = none" mean to run if there are no matching ps processes.
ps-watcher 0.93 -- first general release. ps-watcher 0.93 -- first general release.
$Id: NEWS,v 1.28 2008/12/25 16:39:17 rockyb Exp $ $Id: NEWS,v 1.29 2009/03/15 06:59:23 rockyb Exp $

4
THANKS
View file

@ -13,6 +13,8 @@ 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 program to fire when no matching processes (e.g. when a process that
should be running has died). should be running has died).
Jan Wagner - Debian packaging and support; pidfile support addition.
Thanks to Jason Welsh <jason at monsterjam dot org> for helping to track down Thanks to Jason Welsh <jason at monsterjam dot org> for helping to track down
a Solaris problem where ps returned multiple lines of output. a Solaris problem where ps returned multiple lines of output.
@ -22,7 +24,7 @@ the action statement.
Musicological supervision by Stuart Frankel <gecko@dustyfeet.com>, Musicological supervision by Stuart Frankel <gecko@dustyfeet.com>,
cutrate Ph.D. cutrate Ph.D.
$Id: THANKS,v 1.8 2006/03/08 19:17:33 rockyb Exp $ $Id: THANKS,v 1.9 2009/02/19 16:57:31 rockyb Exp $

2
configure vendored
View file

@ -2007,7 +2007,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=ps-watcher PACKAGE=ps-watcher
VERSION=1.07 VERSION=1.08
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF

View file

@ -18,11 +18,11 @@ dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301 USA. dnl 02110-1301 USA.
dnl $Id: configure.ac,v 1.43 2008/12/25 16:42:49 rockyb Exp $ dnl $Id: configure.ac,v 1.45 2009/03/15 06:59:23 rockyb Exp $
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(ps-watcher.in.in) AC_INIT(ps-watcher.in.in)
AM_INIT_AUTOMAKE(ps-watcher,1.07) AM_INIT_AUTOMAKE(ps-watcher,1.08)
AM_MISSING_PROG(CVS2CL, cvs2cl, $missing_dir) AM_MISSING_PROG(CVS2CL, cvs2cl, $missing_dir)
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

View file

@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man 2.17 (Pod::Simple 3.07) .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ======================================================================== .\" ========================================================================
@ -7,7 +7,7 @@
.if t .Sp .if t .Sp
.ne 5 .ne 5
.PP .PP
\fB\&\\$1\fR \fB\\$1\fR
.PP .PP
.. ..
.de Sp \" Vertical space (when we can't use .PP) .de Sp \" Vertical space (when we can't use .PP)
@ -132,7 +132,7 @@
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "ps-watcher 8" .IX Title "ps-watcher 8"
.TH ps-watcher 8 "2008-12-25" "perl v5.8.8" "User Contributed Perl Documentation" .TH ps-watcher 8 "2009-03-15" "perl v5.10.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents. .\" way too many mistakes in technical documents.
.if n .ad l .if n .ad l

View file

@ -9,8 +9,10 @@
<body style="background-color: white"> <body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN --> <!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul> <ul>
@ -31,7 +33,7 @@
</ul> </ul>
<li><a href="#example_configuration">EXAMPLE CONFIGURATION</a></li> <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="#using__prolog_for_getting_non_ps_information">Using $PROLOG for getting non-ps information</a></li>
<li><a href="#security_considerations">SECURITY CONSIDERATIONS</a></li> <li><a href="#security_considerations">SECURITY CONSIDERATIONS</a></li>
<li><a href="#troubleshooting">TROUBLESHOOTING</a></li> <li><a href="#troubleshooting">TROUBLESHOOTING</a></li>
<li><a href="#bugs">BUGS</a></li> <li><a href="#bugs">BUGS</a></li>
@ -39,9 +41,11 @@
<li><a href="#author">AUTHOR</a></li> <li><a href="#author">AUTHOR</a></li>
<li><a href="#copyright">COPYRIGHT</a></li> <li><a href="#copyright">COPYRIGHT</a></li>
</ul> </ul>
<hr name="index" />
</div>
<!-- INDEX END --> <!-- INDEX END -->
<hr />
<p> <p>
</p> </p>
<h1><a name="name">NAME</a></h1> <h1><a name="name">NAME</a></h1>
@ -58,7 +62,7 @@
<h1><a name="description">DESCRIPTION</a></h1> <h1><a name="description">DESCRIPTION</a></h1>
<p>Periodically a list of processes obtained via <code>ps</code>. More precisely <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 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 the &quot;cmd&quot; field, not the full command and arguments) and its process
id (pid). A configuration file specifies a list of Perl id (pid). A configuration file specifies a list of Perl
regular-expression patterns to match the processes against. For each regular-expression patterns to match the processes against. For each
match, a Perl expression specified for that pattern is evaluated. The match, a Perl expression specified for that pattern is evaluated. The
@ -102,34 +106,34 @@ your configuration).</p>
</p> </p>
<h2><a name="options">OPTIONS</a></h2> <h2><a name="options">OPTIONS</a></h2>
<dl> <dl>
<dt><strong><a name="item__2d_2dhelp">--help</a></strong></dt> <dt><strong><a name="help" class="item">--help</a></strong></dt>
<dd> <dd>
<p>Print a usage message on standard error and exit with a return code <p>Print a usage message on standard error and exit with a return code
of 100.</p> of 100.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2ddoc">--doc</a></strong></dt> <dt><strong><a name="doc" class="item">--doc</a></strong></dt>
<dd> <dd>
<p>Extact the full documentation that you are reading now, print it and <p>Extact the full documentation that you are reading now, print it and
exit with a return code of 101.</p> exit with a return code of 101.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2dversion">--version</a></strong></dt> <dt><strong><a name="version" class="item">--version</a></strong></dt>
<dd> <dd>
<p>Print the version release on standard output and exit with a return <p>Print the version release on standard output and exit with a return
code of 10.</p> code of 10.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2ddebug_number">--debug <em>number</em></a></strong></dt> <dt><strong><a name="debug_number" class="item">--debug <em>number</em></a></strong></dt>
<dd> <dd>
<p>Give debugging output. The higher the number, the more the output. The <p>Give debugging output. The higher the number, the more the output. The
default is 0 = none. 2 is the most debugging output.</p> default is 0 = none. 2 is the most debugging output.</p>
</dd> </dd>
<dt><strong><a name="item__5b_2d_2dconfig_5d_configuration_file">[--config] <em>configuration file</em></a></strong></dt> <dt><strong><a name="config_configuration_file" class="item">[--config] <em>configuration file</em></a></strong></dt>
<dd> <dd>
<p>Specify configuration file. .</p> <p>Specify configuration file. .</p>
@ -138,7 +142,7 @@ of the configuration file and <a href="#example_configuration">EXAMPLE CONFIGURA
example of a configuration file.</p> example of a configuration file.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2dlog__5blog_file_5d">--log [<em>log file</em>]</a></strong></dt> <dt><strong><a name="log_log_file" class="item">--log [<em>log file</em>]</a></strong></dt>
<dd> <dd>
<p>Send or don't send error and debugging output to a log file. If option <p>Send or don't send error and debugging output to a log file. If option
@ -146,39 +150,39 @@ is given but no logfile is specified, then use STDERR. The default is
no error log file. See also --syslog below.</p> no error log file. See also --syslog below.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2dsyslog__7c__2d_2dnosyslog">--syslog | --nosyslog</a></strong></dt> <dt><strong><a name="syslog_nosyslog" class="item">--syslog | --nosyslog</a></strong></dt>
<dd> <dd>
<p>Send or don't send error and debugging output to syslog. The default <p>Send or don't send error and debugging output to syslog. The default
is to syslog error and debug output.</p> is to syslog error and debug output.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2ddaemon__7c__2d_2dnodaemon">--daemon | --nodaemon</a></strong></dt> <dt><strong><a name="daemon_nodaemon" class="item">--daemon | --nodaemon</a></strong></dt>
<dd> <dd>
<p>Run or don't as a daemon.</p> <p>Run or don't as a daemon.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2dpath_search_2dpath">--path <em>search-path</em></a></strong></dt> <dt><strong><a name="path_search_path" class="item">--path <em>search-path</em></a></strong></dt>
<dd> <dd>
<p>Specify the executable search path used in running commands.</p> <p>Specify the executable search path used in running commands.</p>
</dd> </dd>
<dt><strong><a name="item__2d_2dps_2dprog_program">--ps-prog <em>program</em></a></strong></dt> <dt><strong><a name="ps_prog_program" class="item">--ps-prog <em>program</em></a></strong></dt>
<dd> <dd>
<p>One can specify the command that gives ps information. By default, the <p>One can specify the command that gives ps information. By default, the
command is <em>/bin/ps</em>.</p> command is <em class="file">/bin/ps</em>.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2drun__7c__2d_2dnorun">--run | --norun</a></strong></dt> <dt><strong><a name="run_norun" class="item">--run | --norun</a></strong></dt>
<dd> <dd>
<p>do/don't run actions go through the motions as though we were going <p>do/don't run actions go through the motions as though we were going
to. This may be useful in debugging.</p> to. This may be useful in debugging.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__2d_2dsleep_interval_in_seconds">--sleep <em>interval in seconds</em></a></strong></dt> <dt><strong><a name="sleep_interval_in_seconds" class="item">--sleep <em>interval in seconds</em></a></strong></dt>
<dd> <dd>
<p>It is expected that one might want to run ps-watcher over and over <p>It is expected that one might want to run ps-watcher over and over
@ -209,7 +213,7 @@ signal.</p>
<p>The format of a configuration file is a series of fully qualified <p>The format of a configuration file is a series of fully qualified
filenames enclosed in square brackets followed by a number of filenames enclosed in square brackets followed by a number of
parameter lines. Each parameter line has a parameter name followed by parameter lines. Each parameter line has a parameter name followed by
an ``equal'' sign and finally value. That is:</p> an &quot;equal&quot; sign and finally value. That is:</p>
<pre> <pre>
# This is a comment line # This is a comment line
; So is this. ; So is this.
@ -223,36 +227,36 @@ an ``equal'' sign and finally value. That is:</p>
<p>Comments start with # or ; and take effect to the end of the line.</p> <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 <p>This should be familiar to those who have worked with text-readible
Microsoft <code>.INI</code> files.</p> Microsoft <code>.INI</code> files.</p>
<p>Note process patterns, (<em>process-pattern1</em> and <em>process-pattern2</em> <p>Note process patterns, (<em class="file">process-pattern1</em> and <em class="file">process-pattern2</em>
above) must be unique. If there are times when you may want to 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. 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 e.g. <em class="file">cron</em> and <em class="file">[c]ron</em> which refer to the same process even
though they <em>appear</em> to be different.</p> though they <em>appear</em> to be different.</p>
<p>As quoted directly from the Config::IniFiles documentation:</p> <p>As quoted directly from the Config::IniFiles documentation:</p>
<p>Multiline or multivalued fields may also be defined ala UNIX <p>Multiline or multivalued fields may also be defined ala UNIX
``here document'' syntax:</p> &quot;here document&quot; syntax:</p>
<pre> <pre>
Parameter=&lt;&lt;EOT Parameter=&lt;&lt;EOT
value/line 1 value/line 1
value/line 2 value/line 2
EOT</pre> EOT</pre>
<p>You may use any string you want in place of ``EOT''. Note <p>You may use any string you want in place of &quot;EOT&quot;. Note
that what follows the ``&lt;&lt;'' and what appears at the end of that what follows the &quot;&lt;&lt;&quot; and what appears at the end of
the text <em>must</em> match exactly, including any trailing the text <em>must</em> match exactly, including any trailing
whitespace.</p> whitespace.</p>
<p>There are two special ``process patterns'': $PROLOG and $EPILOG, the <p>There are two special &quot;process patterns&quot;: $PROLOG and $EPILOG, the
former should appear first and the latter last.</p> former should appear first and the latter last.</p>
<p>You can put perl code to initialize variables here and do cleanup <p>You can put perl code to initialize variables here and do cleanup
actions in these sections using ``perl-action.''</p> actions in these sections using &quot;perl-action.&quot;</p>
<p>A description of parameters names, their meanings and potential values <p>A description of parameters names, their meanings and potential values
follows.</p> follows.</p>
<dl> <dl>
<dt><strong><a name="item_trigger">trigger</a></strong></dt> <dt><strong><a name="trigger" class="item">trigger</a></strong></dt>
<dd> <dd>
<p>This parameter specifies the condition on which a process action is <p>This parameter specifies the condition on which a process action is
fired. The condition is evaluated with Perl <code>eval()</code> and should fired. The condition is evaluated with Perl <code>eval()</code> and should
therefore return something which is equivalent to ``true'' in a Perl therefore return something which is equivalent to &quot;true&quot; in a Perl
expression.</p> expression.</p>
<p>If no trigger is given in a section, true or 1 is assumed and <p>If no trigger is given in a section, true or 1 is assumed and
the action is unconditionally triggered.</p> the action is unconditionally triggered.</p>
@ -267,23 +271,23 @@ the action is unconditionally triggered.</p>
[httpd$] [httpd$]
trigger = $count &lt;= 4</pre> trigger = $count &lt;= 4</pre>
</dd> </dd>
<dt><strong><a name="item_occurs">occurs</a></strong></dt> <dt><strong><a name="occurs" class="item">occurs</a></strong></dt>
<dd> <dd>
<p>This parameter specifies how many times an action should be performed <p>This parameter specifies how many times an action should be performed
on processes matching the section trigger. Acceptable values are on processes matching the section trigger. Acceptable values are
``every'', ``first'', ``first-trigger'', and ``none''.</p> &quot;every&quot;, &quot;first&quot;, &quot;first-trigger&quot;, and &quot;none&quot;.</p>
<p>Setting the occurs value to ``none'' causes the the trigger to be <p>Setting the occurs value to &quot;none&quot; causes the the trigger to be
evaluated when there are no matching processes. Although one might evaluated when there are no matching processes. Although one might
think ``$count == 0'' in the action expression would do the same thing, think &quot;$count == 0&quot; in the action expression would do the same thing,
currently as coded this does not work.</p> currently as coded this does not work.</p>
<p>Setting the occurs value to ``first'' causes the process-pattern rule to <p>Setting the occurs value to &quot;first&quot; causes the process-pattern rule to
be finished after handling the first rule that matches, whether or not the be finished after handling the first rule that matches, whether or not the
trigger evaluated to true.</p> trigger evaluated to true.</p>
<p>Setting the occurs value to ``first-trigger'' causes the process-pattern <p>Setting the occurs value to &quot;first-trigger&quot; causes the process-pattern
rule to be finished after handling the first rule that matches <em>and</em> rule to be finished after handling the first rule that matches <em>and</em>
the trigger evaluates to true.</p> the trigger evaluates to true.</p>
<p>If the item parameter is not specified, ``first'' is assumed.</p> <p>If the item parameter is not specified, &quot;first&quot; is assumed.</p>
<p>Examples:</p> <p>Examples:</p>
<pre> <pre>
[.] [.]
@ -309,7 +313,7 @@ the trigger evaluates to true.</p>
occurs = none occurs = none
action = /etc/init.d/syslogd start</pre> action = /etc/init.d/syslogd start</pre>
</dd> </dd>
<dt><strong><a name="item_action">action</a></strong></dt> <dt><strong><a name="action" class="item">action</a></strong></dt>
<dd> <dd>
<p>This specifies the action, a command that gets run by the system <p>This specifies the action, a command that gets run by the system
@ -318,7 +322,7 @@ shell, when the trigger condition is evaluated to be true.</p>
<pre> <pre>
action = /etc/init.d/market_loader.init restart</pre> action = /etc/init.d/market_loader.init restart</pre>
</dd> </dd>
<dt><strong><a name="item_perl_2daction">perl-action</a></strong></dt> <dt><strong><a name="perl_action" class="item">perl-action</a></strong></dt>
<dd> <dd>
<p>This specifies Perl statements to be eval'd. This can be especially <p>This specifies Perl statements to be eval'd. This can be especially
@ -352,25 +356,25 @@ the name of this program ps-watcher.</p>
<p>The following variables can be used in either the pattern or action <p>The following variables can be used in either the pattern or action
fields.</p> fields.</p>
<dl> <dl>
<dt><strong><a name="item__action">$action</a></strong></dt> <dt><strong><a name="_action" class="item">$action</a></strong></dt>
<dd> <dd>
<p>A string containing the text of the action to run.</p> <p>A string containing the text of the action to run.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__perl_action">$perl_action</a></strong></dt> <dt><strong><a name="_perl_action" class="item">$perl_action</a></strong></dt>
<dd> <dd>
<p>A string containing the text of the perl_action to run.</p> <p>A string containing the text of the perl_action to run.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__ps_pat">$ps_pat</a></strong></dt> <dt><strong><a name="_ps_pat" class="item">$ps_pat</a></strong></dt>
<dd> <dd>
<p>The Perl regular expression specified in the beginning of the section.</p> <p>The Perl regular expression specified in the beginning of the section.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__command">$command</a></strong></dt> <dt><strong><a name="_command" class="item">$command</a></strong></dt>
<dd> <dd>
<p>The command that matched $ps_pat.</p> <p>The command that matched $ps_pat.</p>
@ -387,14 +391,14 @@ case, backticks in $command are escaped.</p>
action = echo \&quot;Looks like you have a big \$command program: \$vsz KB\&quot;</pre> action = echo \&quot;Looks like you have a big \$command program: \$vsz KB\&quot;</pre>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__count">$count</a></strong></dt> <dt><strong><a name="_count" class="item">$count</a></strong></dt>
<dd> <dd>
<p>The number of times the pattern matched. Presumably the number of <p>The number of times the pattern matched. Presumably the number of
processes of this class running.</p> processes of this class running.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__trigger">$trigger</a></strong></dt> <dt><strong><a name="_trigger" class="item">$trigger</a></strong></dt>
<dd> <dd>
<p>A string containing the text of the trigger.</p> <p>A string containing the text of the trigger.</p>
@ -424,7 +428,7 @@ not match depending on which single line of the multiple <code>ps</code> lines i
used.</p> used.</p>
<p></p> <p></p>
<dl> <dl>
<dt><strong><a name="item__args">$args</a></strong></dt> <dt><strong><a name="_args" class="item">$args</a></strong></dt>
<dd> <dd>
<p>The command along with its command arguments. It is possible that this <p>The command along with its command arguments. It is possible that this
@ -432,43 +436,43 @@ is might get truncated at certain length (if ps does likewise as is
the case on Solaris).</p> the case on Solaris).</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__ppid">$ppid</a></strong></dt> <dt><strong><a name="_ppid" class="item">$ppid</a></strong></dt>
<dd> <dd>
<p>The parent process id.</p> <p>The parent process id.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__stime">$stime</a></strong></dt> <dt><strong><a name="_stime" class="item">$stime</a></strong></dt>
<dd> <dd>
<p>The start time of the process.</p> <p>The start time of the process.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__etime">$etime</a></strong></dt> <dt><strong><a name="_etime" class="item">$etime</a></strong></dt>
<dd> <dd>
<p>The end time of the process.</p> <p>The end time of the process.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__pmem">$pmem</a></strong></dt> <dt><strong><a name="_pmem" class="item">$pmem</a></strong></dt>
<dd> <dd>
<p>The process memory.</p> <p>The process memory.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__pcpu">$pcpu</a></strong></dt> <dt><strong><a name="_pcpu" class="item">$pcpu</a></strong></dt>
<dd> <dd>
<p>The percent CPU utilization.</p> <p>The percent CPU utilization.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__tty">$tty</a></strong></dt> <dt><strong><a name="_tty" class="item">$tty</a></strong></dt>
<dd> <dd>
<p>The controlling tty.</p> <p>The controlling tty.</p>
<p></p> <p></p>
</dd> </dd>
<dt><strong><a name="item__vsz">$vsz</a></strong></dt> <dt><strong><a name="_vsz" class="item">$vsz</a></strong></dt>
<dd> <dd>
<p>Virtual memory size of the process</p> <p>Virtual memory size of the process</p>
@ -540,7 +544,7 @@ and <code>DAYS</code> respectively and they have the expected definitions:</p>
<p> <p>
</p> </p>
<hr /> <hr />
<h1><a name="using__prolog_for_getting_nonps_information">Using $PROLOG for getting non-ps information</a></h1> <h1><a name="using__prolog_for_getting_non_ps_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 <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 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> use of lsof to check port 3333 and the $PROLOG make sure it runs.</p>
@ -609,7 +613,7 @@ variables.</p>
<p>See also <em>ps(1)</em> and <em>syslogd(8)</em>.</p> <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 <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 another program I distributed. It shows the process tree dynamically
updated using X Motif and tries to display the output ``attractively'' updated using X Motif and tries to display the output &quot;attractively&quot;
but fast. You can the find the homepage at 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://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> <a href="http://prdownloads.sourceforge.net/motif-pstree?sort_by=date&sort=desc">http://prdownloads.sourceforge.net/motif-pstree</a></p>

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# -*- Perl -*- # -*- Perl -*-
use diagnostics; use diagnostics;
my $vcid='$Id: ps-watcher.in.in,v 1.62 2008/12/23 11:09:24 rockyb Exp $ '; my $vcid='$Id: ps-watcher.in.in,v 1.63 2009/02/19 16:57:31 rockyb Exp $ ';
# See usage subroutine or perlpod documentation below. # See usage subroutine or perlpod documentation below.
# Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008 # Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008
@ -23,8 +23,11 @@ my $vcid='$Id: ps-watcher.in.in,v 1.62 2008/12/23 11:09:24 rockyb Exp $ ';
use vars qw($program $ps_cmd $ps_cmdfull $ps_fullcmd_fmt @ps_vars $ps_dvars use vars qw($program $ps_cmd $ps_cmdfull $ps_fullcmd_fmt @ps_vars $ps_dvars
$0 $logopened $ps_args_fmt $args $0 $logopened $ps_args_fmt $args
$count $pid $command $ps_arg_opts $DEVNULL %opts $count $pid $command $ps_arg_opts $DEVNULL %opts $PIDFILE
); );
$PIDFILE = "/var/run/ps-watcher.pid";
use strict; use strict;
BEGIN { require 5.00503 } BEGIN { require 5.00503 }
@ -130,6 +133,7 @@ sub gather_psinfo();
sub read_config($); sub read_config($);
sub check_config_file($); sub check_config_file($);
sub run_trigger($$$); sub run_trigger($$$);
sub check_pid();
init(); init();
process_options(); process_options();
@ -147,7 +151,12 @@ if (!defined($cfg)) {
} }
if ($opts{daemon}) { if ($opts{daemon}) {
daemonize(); if (! check_pid()) {
exit 1;
}
if (! daemonize()) {
exit 1;
}
} }
install_handlers(); install_handlers();
@ -586,14 +595,62 @@ PARTICULAR PURPOSE.
exit 10; exit 10;
} }
sub check_pid() {
if (-f $PIDFILE) {
if (open(PID,$PIDFILE)) {
my $pid = <PID>;
if (!close(PID)) {
logger("Unable to close file handle PID for file '$PIDFILE': $!");
return;
}
if (-f "/proc/$pid/stat") {
if (open(FH,"/proc/$pid/stat")) {
my $line = <FH>;
if (!close(FH)) {
logger("Unable to close file handle FH for file '/proc/$pid/stat': $!");
return;
}
if ($line =~ /\d+[^(]*\((.*)\)\s*/) {
my $process = $1;
if ($process =~ /^$program$/) {
logger("$program already running at PID $pid; exiting.");
exit(0);
}
}
} else {
logger("Unable to open file handle FH for file '/proc/$pid/stat': $!");
return;
}
} else {
logger("Removing stale PID file.");
unlink($PIDFILE);
}
}else{
logger("Unable to open file handle PID for file '$PIDFILE': $!");
return;
}
}
return 1;
}
sub daemonize() { sub daemonize() {
chdir '/' or die "Can't chdir to /: $!"; chdir '/' or die "Can't chdir to /: $!";
defined(my $pid = fork) or die "Can't fork: $!"; defined(my $pid = fork) or die "Can't fork: $!";
exit 0 if $pid; exit 0 if $pid;
if (open(FH,">$PIDFILE")) {
print FH $$;
if (!close(FH)) {
logger("Unable to close file handle FH for file '$PIDFILE': $!");
return;
}
} else {
logger("Unable to open file handle FH for file '$PIDFILE': $!");
return;
}
use POSIX qw(setsid); use POSIX qw(setsid);
setsid() or die "Can't start a new session: $!"; setsid() or die "Can't start a new session: $!";
umask 0; umask 0;
return 1;
} }
# Time configuration file was last read. # Time configuration file was last read.

View file

@ -1,7 +1,7 @@
#!@PERL@ -w #!@PERL@ -w
# -*- Perl -*- # -*- Perl -*-
use diagnostics; use diagnostics;
my $vcid='$Id: ps-watcher.in.in,v 1.62 2008/12/23 11:09:24 rockyb Exp $ '; my $vcid='$Id: ps-watcher.in.in,v 1.63 2009/02/19 16:57:31 rockyb Exp $ ';
# See usage subroutine or perlpod documentation below. # See usage subroutine or perlpod documentation below.
# Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008 # Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2008
@ -23,8 +23,11 @@ my $vcid='$Id: ps-watcher.in.in,v 1.62 2008/12/23 11:09:24 rockyb Exp $ ';
use vars qw($program $ps_cmd $ps_cmdfull $ps_fullcmd_fmt @ps_vars $ps_dvars use vars qw($program $ps_cmd $ps_cmdfull $ps_fullcmd_fmt @ps_vars $ps_dvars
$0 $logopened $ps_args_fmt $args $0 $logopened $ps_args_fmt $args
$count $pid $command $ps_arg_opts $DEVNULL %opts $count $pid $command $ps_arg_opts $DEVNULL %opts $PIDFILE
); );
$PIDFILE = "/var/run/ps-watcher.pid";
use strict; use strict;
BEGIN { require 5.00503 } BEGIN { require 5.00503 }
@ -130,6 +133,7 @@ sub gather_psinfo();
sub read_config($); sub read_config($);
sub check_config_file($); sub check_config_file($);
sub run_trigger($$$); sub run_trigger($$$);
sub check_pid();
init(); init();
process_options(); process_options();
@ -147,7 +151,12 @@ if (!defined($cfg)) {
} }
if ($opts{daemon}) { if ($opts{daemon}) {
daemonize(); if (! check_pid()) {
exit 1;
}
if (! daemonize()) {
exit 1;
}
} }
install_handlers(); install_handlers();
@ -576,14 +585,62 @@ PARTICULAR PURPOSE.
exit 10; exit 10;
} }
sub check_pid() {
if (-f $PIDFILE) {
if (open(PID,$PIDFILE)) {
my $pid = <PID>;
if (!close(PID)) {
logger("Unable to close file handle PID for file '$PIDFILE': $!");
return;
}
if (-f "/proc/$pid/stat") {
if (open(FH,"/proc/$pid/stat")) {
my $line = <FH>;
if (!close(FH)) {
logger("Unable to close file handle FH for file '/proc/$pid/stat': $!");
return;
}
if ($line =~ /\d+[^(]*\((.*)\)\s*/) {
my $process = $1;
if ($process =~ /^$program$/) {
logger("$program already running at PID $pid; exiting.");
exit(0);
}
}
} else {
logger("Unable to open file handle FH for file '/proc/$pid/stat': $!");
return;
}
} else {
logger("Removing stale PID file.");
unlink($PIDFILE);
}
}else{
logger("Unable to open file handle PID for file '$PIDFILE': $!");
return;
}
}
return 1;
}
sub daemonize() { sub daemonize() {
chdir '/' or die "Can't chdir to /: $!"; chdir '/' or die "Can't chdir to /: $!";
defined(my $pid = fork) or die "Can't fork: $!"; defined(my $pid = fork) or die "Can't fork: $!";
exit 0 if $pid; exit 0 if $pid;
if (open(FH,">$PIDFILE")) {
print FH $$;
if (!close(FH)) {
logger("Unable to close file handle FH for file '$PIDFILE': $!");
return;
}
} else {
logger("Unable to open file handle FH for file '$PIDFILE': $!");
return;
}
use POSIX qw(setsid); use POSIX qw(setsid);
setsid() or die "Can't start a new session: $!"; setsid() or die "Can't start a new session: $!";
umask 0; umask 0;
return 1;
} }
# Time configuration file was last read. # Time configuration file was last read.