Simple proof-of-concept for killing a hard-to-kill process
Switch branches/tags
Nothing to show
Clone or download
George Dunlap
George Dunlap Add copyright notices and licensing information
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Latest commit cbc57a1 May 16, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add .gitignore May 16, 2018
COPYING Add copyright notices and licensing information May 16, 2018
Makefile Initial commit Mar 27, 2018
README.md Add README.md, and some comments May 16, 2018
common.h Initial commit Mar 27, 2018
reaper.c Add copyright notices and licensing information May 16, 2018
runner.c Add copyright notices and licensing information May 16, 2018

README.md

This is a pair of programs to demonstrate how to kill an uncooperative process.

Quick-start

  1. You probably want to run this in a VM in case something goes terribly wrong

  2. Compile:

    make

This will generate two binaries, runner (the process trying to avoid being killed) and reaper (the process which is to kill it).

  1. Start the runner

    ./runner

This will execute the following loop:

    while(1) {
        if(!fork())
            kill(-1, 9);
        else
            _exit(0);
    }
  1. Try to kill it with the normal tools

ps, pipe, killall -- all may probabilistically kill it, but that's not very satisfactory, is it?

  1. Kill it with the reaper

    ./reaper

To demonstrate its invulnerability, it waits 1 second before killing runner, giving it every chance to lose a race.