Commit Graph

367 Commits

Author SHA1 Message Date
2fbe59b1d9 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 73210671764fc3de133a627205582e069e1ff43d
Component: engine
2014-08-11 11:47:21 -07:00
349e2e4036 Merge pull request #7502 from LK4D4/catch_error_console
Catch error on console creation
Upstream-commit: e033425f0bcf58f1409e7a10a408c778f1c754e4
Component: engine
2014-08-11 12:13:53 -04:00
10183d52c2 Catch error on console creation
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 93f6cf035156d3b17cbf61f1a61926c068bd8e92
Component: engine
2014-08-09 22:10:44 +04:00
6fa220da5d Fix error message on logging events
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 7afc49b40bd3a2c86a807a5ab4c722b12932d856
Component: engine
2014-08-09 18:45:38 +04:00
90ba5c6273 Remove last trace of Daemon->Server dependency
This removes a shim `daemon.Server` interface which was used to start
separating Daemon from Server *gradually*, without getting cyclic
dependency errors.

Now that the last Daemon->Server dependency has been removed, we can
finally remove the shim. Yay!

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 20b0841c1bd07c6add812597e0d656d7584e48ac
Component: engine
2014-08-06 17:56:12 +00:00
812a1a7ed4 Replace Server.IsRunning with Engine.IsShutdown
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 78f0a914ee982126793534286682e6c6e4270e97
Component: engine
2014-08-06 17:56:11 +00:00
727879ad53 Cleanup: refactor shutdown and signal handling facility
This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: c9f3fd3fc7a4beb97de40ef8da7330b23397d9d3
Component: engine
2014-08-06 17:56:11 +00:00
9a5247f7ee Move "info" to daemon/info.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 94715e8e643f0bc9aa57841b346f5196f75f0dc0
Component: engine
2014-08-08 03:01:55 +00:00
722d8e53b5 Merge pull request #7374 from cpuguy83/revert_rm_f_deprecation
Revert --stop/--kill and use SIGKILL instead
Upstream-commit: 414ccee23a25df258f9496e721dbfb6f1773ea9a
Component: engine
2014-08-07 16:47:25 -07:00
c29fd30ad7 Merge pull request #7453 from shykes/new-subsystem-maintainers
Add maintainers to daemon/ and graph/
Upstream-commit: 5d9cfde0df1453ccc66c98cabe42dd640fdb79c2
Component: engine
2014-08-07 16:43:41 -07:00
a79d7ec92b Revert rm -f deprecation use SIGKILL instead
`rm -f` was originally deprecated in favor of `rm --stop/--kill` since `rm
-f` was sending SIGTERM and potentially very slow.
Instead this will bring back `rm -f` but use SIGKILL isntead

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
Upstream-commit: 95f86da641dfec9b3db88e0f0a8457685361a871
Component: engine
2014-08-07 18:20:43 -04:00
bdc2cfec82 Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
Upstream-commit: bc9f5cdeb5c000de5be291a5628d6eb99c1ab91d
Component: engine
2014-08-07 14:51:42 -07:00
456929c3f9 Merge pull request #7389 from tianon/replace-amd64-build-tags-with-cgo-as-appropriate
Replace amd64 build tags with cgo as appropriate
Upstream-commit: ab3e34e1874872854e93c290990e081e1b202b65
Component: engine
2014-08-07 16:24:19 -04:00
a4215f0a92 Merge pull request #7443 from ewindisch/name-id-lookup-reversal
Container name lookups to prefer IDs over names
Upstream-commit: 140e6abb17a85a569416236352a4fb07ce508480
Component: engine
2014-08-07 11:14:47 -07:00
51a5b1b1f0 Merge pull request #7446 from cpuguy83/cleanup_extract_bindmount_spec_parsing
Cleanup: extract bindmount spec parsing
Upstream-commit: dc296903f072b8e710954954acecad4ccd4e04b6
Component: engine
2014-08-07 11:48:07 -04:00
30c7baef5a Merge pull request #7452 from shykes/7370-on-7427
Cleanup: move image management and logging out of deprecated Server
Upstream-commit: 7e12911f62080a5bf2f8da8583eebe95c648da68
Component: engine
2014-08-06 18:47:45 -07:00
5247a2be66 port usage of jsonlog to the new daemon files which were refactored
recently.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: bd373712d069f5f1f8d65bc25808a068a9afdd13
Component: engine
2014-08-06 16:45:04 -07:00
00eca7c915 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 5ab09f2f7129225220fc9c0b76b2e2aec6823ee1
Component: engine
2014-08-06 16:37:01 -07:00
416ed08d2b Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 89ec17d11319ae39bff19985ac59fc878fe1fe1e
Component: engine
2014-08-06 17:20:21 -06:00
c3c811b0a6 Merge pull request #7430 from tamsky/docfixes
style, grammar, spelling fixes.
Upstream-commit: bc684fae642dbf585215b9518f469634a52a5524
Component: engine
2014-08-06 16:11:52 -07:00
955fb61f46 Merge pull request #7431 from tamsky/fixes-7105
add warning re: changing value of `dm.basesize`.
Upstream-commit: e86d87e1ce8c67f0463d76f6c438a19c859f1bd3
Component: engine
2014-08-06 15:22:42 -07:00
2e8acb9277 Cleanup: extract bindmount spec parsing
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
Upstream-commit: f34679d0a999eaf370f3544cd1c21b90b8876795
Component: engine
2014-08-06 17:22:40 -04:00
c1114b1805 Container name lookups to prefer IDs over names
Lookups of container names should prefer the ID over
names assigned to containers by users.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 231e07ded4debc69422696cacc069a47a77e3175
Component: engine
2014-08-06 13:09:11 -04:00
c3b263a99f Add maintainers to daemon/ and graph/
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 5240e5f71380b68792abcd3cf54283385ec7a4f0
Component: engine
2014-08-06 10:29:15 +00:00
a40eb6a232 Rename "log_event" to "log"
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 1c11d7f93e2070c94ad22dfec3336eb1cd548280
Component: engine
2014-08-06 10:08:23 +00:00
a195939eec Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 8d056423f8c433927089bd7eb6bc97abbc1ed502
Component: engine
2014-08-06 10:08:19 +00:00
f301b073e0 Move "image_delete" to daemon/image_delete.go
Note: this cannot yet be moved to graph/ because of a lingering
dependency on daemon. This has been noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 7a5e3df1625df24d52e2c863706076c59803cff8
Component: engine
2014-08-06 17:18:50 -04:00
a062aab14b add warning re: changing value of dm.basesize.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
Upstream-commit: bd30746e07e18942cea4f2d15a45fd357c957e4f
Component: engine
2014-08-05 19:28:07 -07:00
88553ea651 style, grammar, spelling fixes.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
Upstream-commit: 07099b62563f3201877995181825d4cd4822ed89
Component: engine
2014-08-05 18:11:32 -07:00
05babb14b7 Docker should use /var/lib/container/tmp for large temporary files.
/tmp is often a tmpfs file system and large temporary files could cause
docker commands to fail.  Also using /tmp potentially allows users on the
system to get access to content, or even attack the content.  Moving the tmpdir to
/var/lib/container/tmp will protect the data.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

Conflicts:
	docker/docker.go
Upstream-commit: b4813f2841638be28208b7b1602f12750a46ece9
Component: engine
2014-08-05 16:43:42 -04:00
5c55cb7669 Purge the bits of pkg/system that moved to libcontainer/system
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 60341f80d7b7918d1c1eff7c38cbc55c9bdec4d9
Component: engine
2014-08-02 01:35:04 -06:00
576cbbee0d Merge pull request #7378 from rajdeepd/master
Added test cases for no port, -ve port passed to nat.ParsePortSpecs 
Upstream-commit: 69aa07af1ef72f08b16f04010704ade669db28df
Component: engine
2014-08-01 13:45:17 -07:00
529952baed Cleanup daemon/Daemon.Install for readability
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: f46de04af65968f704f08681e4cf6c35e20b0697
Component: engine
2014-08-01 14:25:02 -04:00
d37dbe0e16 Move "containers" to daemon/list.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: d0370076585f506d2f81af3fb3dab56119bdc0e9
Component: engine
2014-08-01 14:24:58 -04:00
021f4f3886 Move "top" to daemon/top.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: aa49632feff937287cd6f6413d665ec74f49779c
Component: engine
2014-08-01 14:24:52 -04:00
5860a921ea Move "changes" to daemon/changes.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

Fix issues with renaming changes to container_changes
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 49e61f62ced4e111071cf9439e3264f06b008c6c
Component: engine
2014-08-01 14:24:46 -04:00
0ebd905508 Move "copy" to daemon/copy.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 06229a4b76aa221d08cfb1888b919da31c49194f
Component: engine
2014-08-01 14:24:41 -04:00
7de8df549d Move "delete" to daemon/delete.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

Fix issues with renaming container_delete to delete
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: cc39d579f50b67617388117e5afbb47351b59337
Component: engine
2014-08-01 14:24:28 -04:00
4105732535 Move "logs" to daemon/logs.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 066330fc9687edd3f8a5066fd4201ea14af15f93
Component: engine
2014-08-01 14:17:29 -04:00
dbae09b75e Move "commit" to daemon/commit.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: fdad41f5b921dfa06eec613b86147a22aeea5835
Component: engine
2014-08-01 14:17:24 -04:00
7bdcca558d Move "resize" to daemon/resize.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: e0fd96f850a65cfa6b386fb6b91ee8ced58f5fc2
Component: engine
2014-08-01 14:17:20 -04:00
371adef863 Move "wait" to daemon/wait.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: c4ce396f461a75ab887f3e1a2dcc54b10fc20423
Component: engine
2014-08-01 14:17:16 -04:00
82a821883f Move "restart" to daemon/restart.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: bd54a73c42760cc94f90df253ecf0818a3006277
Component: engine
2014-08-01 14:17:11 -04:00
3225e05f70 Move "start" to daemon/start.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 4180b87514b98ed72498073382cbaeeb5e90191a
Component: engine
2014-08-01 14:17:04 -04:00
4b7b997c6f Move "stop" to daemon/stop.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 03c07617cce5167ac854ff84637be9cccef39328
Component: engine
2014-08-01 14:16:59 -04:00
28fbe12f7b Move "create" to daemon/create.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 80f3272ee9957c537271462a688a7de88aaa92c0
Component: engine
2014-08-01 14:16:50 -04:00
6c8c9d698d Move "export" to daemon/export.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 8031c23b0f492b6f62dfc226dbf9b3d051d9546a
Component: engine
2014-08-01 14:16:41 -04:00
66a8cb6b3e Move "kill" to daemon/kill.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 8652830661f648d585a61479a88ada01010b7fc8
Component: engine
2014-08-01 14:16:05 -04:00
9001ffa499 Added test cases for no port passed to nat.ParsePortSpecs and negative port number passed
Docker-DCO-1.1-Signed-off-by: Rajdeep due <dua_rajdeep@yahoo.com> (github: rajdeepd)
Upstream-commit: 4cb2cfed9ffd8a10e5a47b41b26313dd94a86dc1
Component: engine
2014-08-01 23:41:34 +05:30
be8ae878bc Merge pull request #7295 from vishh/rbind
Make lxc driver rbind all user specified mounts.
Upstream-commit: 5d2a62d8de5422b29daa12eef9bd475e2a9b1cb4
Component: engine
2014-08-01 10:25:45 -07:00