1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api
Michael Crosby ee3ac3aa66 Add init process for zombie fighting
This adds a small C binary for fighting zombies.  It is mounted under
`/dev/init` and is prepended to the args specified by the user.  You
enable it via a daemon flag, `dockerd --init`, as it is disable by
default for backwards compat.

You can also override the daemon option or specify this on a per
container basis with `docker run --init=true|false`.

You can test this by running a process like this as the pid 1 in a
container and see the extra zombie that appears in the container as it
is running.

```c

int main(int argc, char ** argv) {
	pid_t pid = fork();
	if (pid == 0) {
		pid = fork();
		if (pid == 0) {
			exit(0);
		}
		sleep(3);
		exit(0);
	}
	printf("got pid %d and exited\n", pid);
	sleep(20);
}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-19 17:33:50 -07:00
..
errors Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
fixtures Add more unit tests (thus coverage) to pkg api 2015-08-04 19:51:02 +02:00
server Use apiError in server version middleware. 2016-09-16 12:27:14 -04:00
types Add init process for zombie fighting 2016-09-19 17:33:50 -07:00
common.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
common_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
README.md Update README.md 2014-07-04 18:21:13 +09:00

This directory contains code pertaining to the Docker API:

  • Used by the docker client when communicating with the docker daemon

  • Used by third party tools wishing to interface with the docker daemon