tests: check orphaned processes are reaped
This commit is contained in:
1 parent
10d2fdea92
commit
26e3232f2c
17 files changed
+174
No files matched your search
@@ -0,0 +1 @@
|
||||
/ go
|
||||
@@ -0,0 +1,11 @@
|
||||
FROM golang:1.12
|
||||
|
||||
ADD . /go/src/github.com/dokku/apps/web
|
||||
WORKDIR /go/src/github.com/dokku/apps/web
|
||||
|
||||
RUN go install -v ./...
|
||||
|
||||
ENV TINI_VERSION v0.18.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
RUN chmod +x /tini
|
||||
ENTRYPOINT ["/tini", "--"]
|
||||
@@ -0,0 +1 @@
|
||||
web: /go/bin/web
|
||||
@@ -0,0 +1,3 @@
|
||||
module dokku.me/web
|
||||
|
||||
go 1.12
|
||||
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// spawn an orphaned zombie
|
||||
err := exec.Command("/bin/bash", "-c", "/bin/false &").Run()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
http.HandleFunc("/", hello)
|
||||
fmt.Println("listening...")
|
||||
err = http.ListenAndServe(":"+os.Getenv("PORT"), nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func hello(res http.ResponseWriter, req *http.Request) {
|
||||
fmt.Fprintln(res, "go")
|
||||
}
|
||||
Reference in new issue
Block a user