Skip to content

Simple proof-of-concept for killing a hard-to-kill process

License

Notifications You must be signed in to change notification settings

gwd/runner-reaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple proof-of-concept for killing a hard-to-kill process

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published