aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2018-08-31 12:57:03 +0200
committerSebastiaan van Stijn <github@gone.nl>2018-08-31 15:11:28 +0200
commite7ad8e2b283d801700f85cb99b1b6ed19907186a (patch)
tree98fd0f3254d284bf35d1036629fad2da5c235858 /contrib
parentf30757f439bce71dec312d0797e9c80a06e98058 (diff)
systemd: add support for reloading daemon configuration through systemd
This adds support for reloading the docker daemon (SIGHIUP) so that changes in '/etc/docker/daemon.json' can be loaded at runtime by reloading the service through systemd ('systemctl reload docker') Before this change, systemd would output an error that "reloading" is not supported for the docker service; systemctl reload docker Failed to reload docker.service: Job type reload is not applicable for unit docker.service. After this change, the docker daemon can be reloaded through 'systemctl reload docker', which reloads the configuration; journalctl -f -u docker.service May 02 03:49:20 testing systemd[1]: Reloading Docker Application Container Engine. May 02 03:49:20 testing docker[28496]: time="2016-05-02T03:49:20.143964103-04:00" level=info msg="Got signal to reload configuration, reloading from: /etc/docker/daemon.json" May 02 03:49:20 testing systemd[1]: Reloaded Docker Application Container Engine. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/init/systemd/docker.service1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service
index 6bfb873fd6..d6527e8a2e 100644
--- a/contrib/init/systemd/docker.service
+++ b/contrib/init/systemd/docker.service
@@ -13,6 +13,7 @@ ExecStartPre=/usr/libexec/containerd-offline-installer /var/lib/containerd-offli
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
+ExecReload=/bin/kill -s HUP $MAINPID
ExecStopPost=/usr/bin/dockerd post-stop
TimeoutSec=0
RestartSec=2