diff --git a/zombietest/build/Dockerfile b/zombietest/build/Dockerfile new file mode 100644 index 0000000..6672cf8 --- /dev/null +++ b/zombietest/build/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.5.1 + +COPY ../../*.go /go/src/github.com/peterbourgon/runsvinit +RUN go install -v github.com/peterbourgon/runsvinit +RUN mv /go/bin/runsvinit /mount/ + +COPY zombie.c / +RUN cc -Wall -Werror -o /zombie /zombie.c +RUN mv /zombie /mount/ diff --git a/zombietest/build/Makefile b/zombietest/build/Makefile new file mode 100644 index 0000000..25878cd --- /dev/null +++ b/zombietest/build/Makefile @@ -0,0 +1,9 @@ +.PHONY: all +all: zombie runsvinit + +zombie runsvinit: .uptodate + docker run -ti --rm -v $(shell pwd):/mount zombie-build + +.uptodate: Dockerfile ../../*.go + docker build -t zombie-build . + touch $@ diff --git a/zombietest/build/zombie.c b/zombietest/build/zombie.c new file mode 100644 index 0000000..631333b --- /dev/null +++ b/zombietest/build/zombie.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main () +{ + pid_t child_pid; + + child_pid = fork (); + if (child_pid > 0) { + sleep (60); + } + else { + exit (0); + } + return 0; +} +