NAME
pidwatch - Run a command and if another PID exits, kill the command
SYNOPSIS
pidwatch
[--cd cd] --host host --pid pid [args....]
DESCRIPTION
Chdir to the specified directory, if specified and possible.
Run the arguments as a command in the forground. When the forground 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 forground 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. - --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 PID's death. Defaults to HUP.
SEE ALSO
IPC::PidStat
AUTHORS
Wilson Snyder <wsnyder@wsnyder.org>