25 lines
946 B
Markdown
25 lines
946 B
Markdown
# die-with-parent
|
|
|
|
[](https://ci.zander.im/job/die-with-parent-linux/)
|
|
|
|
die-with-parent is a small program that allows you to ensure a child process
|
|
dies when its parent does, even if the parent died due to a SIGKILL. It
|
|
currently only works on Linux (though it could be easily modified to work on
|
|
other OSes in the future).
|
|
|
|
### Building and Installation
|
|
To build, just run `make`. Install with `make install`. Optionally,
|
|
`make PREFIX=path/to/prefix install` can be used to specify an installation
|
|
prefix.
|
|
|
|
### Usage
|
|
To use, wrap the command you want to run with `die-with-parent`:
|
|
```sh
|
|
die-with-parent your-command-here -some -cool -args
|
|
```
|
|
to avoid race conditions (see the man page) you should pass the parent process'
|
|
PID with the `-p` flag. For example, in `sh` or `bash`:
|
|
```sh
|
|
die-with-parent -p $$ your-command-here -some -cool -args
|
|
```
|