|
NAMEpidwatch - Run a command and if another PID exits, kill the commandSYNOPSISpidwatch [--cd I<cd>] --host <host> --pid <pid> args[....] pidwatch [--cd I<cd>] --host <host> --pid <pid> --foreground <pid> DESCRIPTIONChdir to the specified directory, if specified and possible, then run the arguments as a command in the foreground. When the foreground process exits, return its exit status. This is basically the same as running the command directly.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. Alternatively pass the PID of any process with --foreground. When the foreground process exits, the background job exits; if the specified watched PID exits, the foreground pid is killed. 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..."); Another usage is as a "barrier" to start the new step in a script when another process completes. Just use a sleep with a appropriate timeout value: pidwatch --host HOST --pid PID sleep 9999999 echo PID has completed, do whatever is next ARGUMENTS
DISTRIBUTIONThe latest version is available from CPAN and from <https://www.veripool.org/ipc-locker>.Copyright 2002-2019 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 Version 3 or the Perl Artistic License Version 2.0. AUTHORSWilson Snyder <wsnyder@wsnyder.org>SEE ALSOIPC::Locker, IPC::PidStat, pidstat, pidstatd, pidwatch, uriexec
Visit the GSP FreeBSD Man Page Interface. |