ifpl runs the given command (say, as process p1) and waits for a process with a specified pid (process p2) to terminate. Upon termination of p2, ifpl will kill p1.
$ ifpl [-h] [-p PID] [-s SIGNAL] [-v] [-l LOGFILE] CMD [ARGS ...]
Where:
-h
displays a help message-p PID
specifies the PID of the process to wait for to terminate. Defaults to ppid of ifpl.-s SIGNAL
specifies a signal to send to theCMD
child process-v
prints ifpl log messages to stdout-l LOGFILE
file to write log messages toCMD [ARGS ...]
specifies the CMD and optionally arguments
ifpl runs the given CMD
and waits for the process with pid PID
to terminate.
Upon termination, the CMD
child process will be killed.
When the -s
option is specified with a non-negative value, the given signal will be sent to the CMD child process.
Otherwise go's os.Process.Kill() will be used.
ifpl returns with the exit status of CMD
or with 255 if an error occurred.
Currently, ifpl runs on Microsoft Windows. For Unix/Linux procfs is required.
Prerequisites:
- Go1.14
- Make (optional)
To compile:
$ cd cmd/ifpl
$ go build
To build distributable archives for Linux & Windows:
$ make dist-windows-x86-64 dist-linux-x86-64 dist-linux-arm64