Add config parameter to change stop timeout during daemon shutdown

This fix tries to add a daemon config parameter `--shutdown-timeout`
that specifies the timeout value to stop containers gracefully
(before SIGKILL). The default value is 15s.

The `--shutdown-timeout` parameter is added to daemon options and
config file. It will also be updated during daemon reload.

Additional test cases have been added to cover the change.

This fix fixes #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-05-26 14:07:30 -07:00 коммит произвёл Tibor Vass
Родитель fb789bd06d
Коммит ef158e3e0a
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -64,6 +64,7 @@ Options:
--raw-logs Full timestamps without ANSI coloring --raw-logs Full timestamps without ANSI coloring
--registry-mirror value Preferred Docker registry mirror (default []) --registry-mirror value Preferred Docker registry mirror (default [])
--selinux-enabled Enable selinux support --selinux-enabled Enable selinux support
--shutdown-timeout=15 Set the shutdown timeout value in seconds
-s, --storage-driver string Storage driver to use -s, --storage-driver string Storage driver to use
--storage-opt value Storage driver options (default []) --storage-opt value Storage driver options (default [])
--swarm-default-advertise-addr string Set default address or interface for swarm advertised address --swarm-default-advertise-addr string Set default address or interface for swarm advertised address
@ -1118,6 +1119,7 @@ This is a full example of the allowed configuration options on Linux:
"cluster-advertise": "", "cluster-advertise": "",
"max-concurrent-downloads": 3, "max-concurrent-downloads": 3,
"max-concurrent-uploads": 5, "max-concurrent-uploads": 5,
"shutdown-timeout": 15,
"debug": true, "debug": true,
"hosts": [], "hosts": [],
"log-level": "", "log-level": "",
@ -1194,6 +1196,7 @@ This is a full example of the allowed configuration options on Windows:
"graph": "", "graph": "",
"cluster-store": "", "cluster-store": "",
"cluster-advertise": "", "cluster-advertise": "",
"shutdown-timeout": 15,
"debug": true, "debug": true,
"hosts": [], "hosts": [],
"log-level": "", "log-level": "",

Просмотреть файл

@ -56,6 +56,7 @@ dockerd - Enable daemon mode
[**--registry-mirror**[=*[]*]] [**--registry-mirror**[=*[]*]]
[**-s**|**--storage-driver**[=*STORAGE-DRIVER*]] [**-s**|**--storage-driver**[=*STORAGE-DRIVER*]]
[**--selinux-enabled**] [**--selinux-enabled**]
[**--shutdown-timeout**[=*15*]]
[**--storage-opt**[=*[]*]] [**--storage-opt**[=*[]*]]
[**--swarm-default-advertise-addr**[=*IP|INTERFACE*]] [**--swarm-default-advertise-addr**[=*IP|INTERFACE*]]
[**--tls**] [**--tls**]
@ -246,6 +247,9 @@ output otherwise.
**--selinux-enabled**=*true*|*false* **--selinux-enabled**=*true*|*false*
Enable selinux support. Default is false. Enable selinux support. Default is false.
**--shutdown-timeout**=*15*
Set the shutdown timeout value in seconds. Default is `15`.
**--storage-opt**=[] **--storage-opt**=[]
Set storage driver options. See STORAGE DRIVER OPTIONS. Set storage driver options. See STORAGE DRIVER OPTIONS.