Skip to content

[18.09] Update new systemd unit file with changes from upstream#182

Merged
seemethere merged 7 commits intodocker:18.09from
seemethere:backport_systemd
Sep 6, 2018
Merged

[18.09] Update new systemd unit file with changes from upstream#182
seemethere merged 7 commits intodocker:18.09from
seemethere:backport_systemd

Conversation

@seemethere
Copy link
Contributor

Cherry pick of #179

❯ git cherry-pick -x -s da69663b9ccd72d95ec60007ef707d82a35324fa 68e15413dce8d6e8f428ac286641a9482d30aabc 82fe96733f551d36018c3840cf21d813807e9b76 e134e666a585b1f13e9e5e371dd93e5ce04a4b34 d736ae9da7401f58
2469fa7e943adde9f2163024 3e1b508e5f70b35869d9c8417d3b65a141820af9 2c2bfea5d009fb884f5c61b62e3c85bd88e7909e

Cherry pick was clean

Original Text:

The new systemd unit file was missing various options; this PR is porting those options. I wasn't sure if all options should be set in the new situation, so I included each change in a separate commit, keeping the original upstream commit message where applicable;

I can drop commits that are not needed 👍

set LimitCORE=infinity to ensure complete core creation,
allows extraction of as much information as possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit da69663)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
There is a not-insignificant performance overhead for all containers (if
containerd is a child of Docker, which is the current setup) if systemd
sets rlimits on the main Docker daemon process (because the limits
propogate to all children).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 68e1541)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Systemd sets a default of 512 tasks, which is far
too low to run many containers.

Note that TasksMax is only supported on systemd 226
and above.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 82fe967)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
We need to add delegate yes to docker's service file so that it can
manage the cgroups of the processes that it launches without systemd
interfering with them and moving the processes after it is reloaded.

       Delegate=
           Turns on delegation of further resource control partitioning to
           processes of the unit. For unprivileged services (i.e. those
           using the User= setting), this allows processes to create a
           subhierarchy beneath its control group path. For privileged
           services and scopes, this ensures the processes will have all
           control group controllers enabled.

This is the proper fix for issue moby/moby#20152

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e134e66)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Change the kill mode to process so that systemd does not kill container
processes when the daemon is shutdown but only the docker daemon

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d736ae9)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
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>
(cherry picked from commit 3e1b508)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229
(systemd/systemd@6bf0f40)
both the old, and new location are accepted by systemd 229 and up, so using the old location
to make them work for either version of systemd.

StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230
(systemd/systemd@f0367da)
both the old, and new name are accepted by systemd 230 and up, so using the old name to make
this option work for either version of systemd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2c2bfea)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
@seemethere seemethere added the backport Backports to release branches label Sep 4, 2018
@seemethere seemethere requested review from a team and thaJeztah September 4, 2018 14:58
Copy link
Contributor

@dave-tucker dave-tucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seemethere seemethere merged commit a354d5f into docker:18.09 Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backports to release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants