Skip to content
A Go package that builds an executable intermediary process runner.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


"reaper" utilizes the reap package to build an executable intermediary process runner. This runner is meant to be executed by other Go programs, in order to create detached processes for them.


Run go get

In order for the reaper executable to work, you must have $GOPATH/bin in your $PATH environment variable.


This package is not a library. It provides an executable that can be used by other programs, therefore importing it doesn't do anything.


Here's a simple example of the syntax:

package main

import (

func main() {

	// prepare a buffer, to which the PID will be written
	var stdout bytes.Buffer

	// prepare the command
	sleepCmd := exec.Command("reaper", "-cmd='sleep'", "-args='30'")
	sleepCmd.Stdout = &stdout

	// run the command
	err := sleepCmd.Run()
	if nil != err {

	// convert the PID string to a valid integer
	pidInt, err := strconv.ParseInt(stdout.String(), 10, 64)
	if nil != err {
	pid := int(pidInt)
	fmt.Printf("Created a detached process with an ID of %d!\n", pid)

That's all, enjoy!

You can’t perform that action at this time.