Initial commit

This commit is contained in:
2026-01-10 02:18:04 -08:00
commit 79e610fa09
7 changed files with 1006 additions and 0 deletions

22
README.md Normal file
View File

@ -0,0 +1,22 @@
# die-with-parent
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
```