NAME
pidwatch - Run a command and if another PID exits, kill the command
SYNOPSIS
pidwatch [--cd I<cd>] --host <host> --pid <pid> [args....]
DESCRIPTION
Chdir to the specified directory, if specified and possible.
Run the arguments as a command in the foreground. When the foreground process exits, return its exit status.
In the background, watch the specified pid on the specified host. If pidstatd is running on the specified host, and the specified pid goes away, kill the foreground command.
Common usage is to kill remote rsh children when a parent is kill -9ed. An example Perl application would invoke:
system("rsh \$remote_host pidwatch"
." --cd \$ENV{PWD} --host \$ENV{HOST} --pid \$\$"
."\$remote_command...");
ARGUMENTS
- --cd dir
-
Directory to chdir to.
- --help
-
Displays this message and program version and exits.
- --host host
-
Hostname to check for specified pid on. pidstatd must be running on that host to have this program be useful.
- --killer program
-
Program to use instead of kill when it's time to terminate the pid. Will be passed arguments as if it was /bin/kill (program signame pid).
- --pid pid
-
Process ID to watch. When this pid exits, the program will kill the foreground process.
- --port port
-
Port of pidstatd server on remote host.
- --signal signame
-
Signal number/name to send to process on remote PIDs death. Defaults to -HUP.
DISTRIBUTION
The latest version is available from CPAN and from http://www.veripool.com/.
Copyright 2002-2004 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License or the Perl Artistic License.
AUTHORS
Wilson Snyder <wsnyder@wsnyder.org>