summaryrefslogtreecommitdiff
path: root/contrib/init
Commit message (Collapse)AuthorAgeFilesLines
* Remove Upstart scriptsTianon Gravi2023-05-172-73/+1
| | | | | | Upstart has been EOL for 8 years and isn't used by any distributions we support any more. Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
* fix debian sysvinit script fails to restart docker daemon when stoppedYann Autissier2022-09-111-1/+1
| | | | | Fixes: #44130 Signed-off-by: Yann Autissier <yann.autissier@gmail.com>
* Openrc: Depend on containerd init scriptJan Breig2022-06-011-0/+4
| | | | Signed-off-by: Jan Breig <git@pygos.space>
* Ensure system clock was setMichael Kuehn2021-12-241-1/+1
| | | | | | | | Single-Board Computer and embedded systems might have a clock that is extremely out of sync with reality. Adding this target ensures docker is only started after a somewhat realistic clock was set. More information about the time-set.target can be found here: https://www.freedesktop.org/software/systemd/man/systemd.special.html#time-sync.target Signed-off-by: Michael Kuehn <micha@kuehn.io>
* Move containerd.service from Requires= to Wants=Tianon Gravi2021-07-121-2/+2
| | | | | | | | | | | | | Per the systemd.unit documentation: > If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency After= on the failing unit is set, this unit will not be started. Besides, with or without specifying After=, this unit will be stopped if one of the other units is explicitly stopped. > > Often, it is a better choice to use Wants= instead of Requires= in order to achieve a system that is more robust when dealing with failing services. This should also be generally "safe" given we added `--containerd=/run/containerd/containerd.sock` to the flags we pass to `dockerd`. Signed-off-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Anca Iordache <anca.iordache@docker.com>
* contrib: remove unused "rpm" variant of systemd unitSebastiaan van Stijn2021-05-121-33/+0
| | | | | | | This unit file was created when we packaged rpms without the socket activation unit, but that's no longer the case. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Merge remote-tracking branch 'packaging_tmp/master' into upstream_systemd_unitsSebastiaan van Stijn2021-05-121-12/+25
|\ | | | | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * Revert "systemd: add multi-user.target to After list"Sebastiaan van Stijn2020-12-101-1/+1
| | | | | | | | | | | | | | | | This reverts commit a65c65d801f7c05f38efb0deb7917d598078afc1, which caused the docker service to not be starting, or delayed starting the service in certain conditions. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * Do not "Bind" docker "To" containerd.Michał Kosek2020-11-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | relates to https://github.com/docker/for-linux/issues/678 When using the BindTo directive, Docker is permanently stopped by systemd when containerd is temporarily killed and restarted; Using `Requires` achieves mostly the same, but defines a weaker dependency; https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires= > Requires= > > .. If this unit gets activated, the units listed will be activated as well. > If one of the other units fails to activate, and an ordering dependency > After= on the failing unit is set, this unit will not be started. Besides, > with or without specifying After=, this unit will be stopped if one of the > other units is explicitly stopped. We may want to look into using `Wants=` instead of `Requires=`, because that allows docker to continue running if containerd is restarted, quoting the systemd documentation: > Often, it is a better choice to use Wants= instead of Requires= in order > to achieve a system that is more robust when dealing with failing services. Given that docker will likely still fail if the containerd socket is not present, startup will fail if containerd is not running, but if containerd is restarted, the docker daemon may be able to try reconnecting. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * systemd: set OOMScoreAdjust for dockerdSebastiaan van Stijn2020-10-051-0/+1
| | | | | | | | | | | | | | | | | | dockerd currently sets the oom-score-adjust itself. This functionality was added when we did not yet run dockerd as a systemd service. Now that we do, it's better to instead have systemd handle this. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * systemd: add multi-user.target to After listIsaiah Grace2020-07-291-1/+1
| | | | | | | | Signed-off-by: Isaiah Grace <irgkenya4@gmail.com>
| * Don't disable socket activation when stopping docker serviceSebastiaan van Stijn2020-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | PartOf deactivates the socket whenever the service get deactivated. The socket unit however should be active nevertheless, so that the docker service can be started again through socket activation. Based on the original patch in upstream moby/moby by Max Harmathy. Co-authored-by: Max Harmathy <max.harmathy@web.de> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * systemd: fix typo in TasksMax commentMichael Hudson-Doyle2019-02-271-1/+1
| |
| * systemd: set --containerd socket patch to prevent race-conditionSebastiaan van Stijn2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containerd is now running as a separate service, and should no longer be started as a managed child-process of dockerd. The dockerd service already specifies that it should be started `After` the containerd.service, but there is still a race condition, where containerd is started, but its socket is not yet created. In that situation, `dockerd` detects that the containerd socket is missing, and will start a new instance of containerd (as a managed child-process), which causes live-restore to fail. This patch explicitly sets the `--containerd` daemon option. If this option is set, `dockerd` will not start a new instance of containerd. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * Start docker.service after containerd.servicecorbin-coleman2019-01-141-1/+1
| | | | | | | | Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
| * Add docker.socket requirement for docker.serviceEli Uriegas2018-12-031-0/+1
| | | | | | | | | | | | | | Without this the docker.socket would not start by default when starting the docker.service leading to failures to start. Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Add socket activation for RHEL based distributionsEli Uriegas2018-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | Removes the systemd drop-in unit file for socket activation and instead prefers socket activation by default for both RHEL based and DEBIAN based distributions. Socket activation for RHEL based distributions was tested on CentOS 7 and Fedora 28. Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Add the docker.socket back inEli Uriegas2018-11-152-1/+13
| | | | | | | | | | | | Re-adds the docker.socket file for debian based distributions. Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Restore `Type=notify` in Systemd unitValentin Kulesh2018-10-081-0/+1
| | | | | | | | Signed-off-by: Valentin Kulesh <valentin.kulesh@virtuozzo.com>
| * Remove Environment, not needed anymoreEli Uriegas2018-09-261-3/+0
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Use image artifacts as daemon and dependenciesEli Uriegas2018-09-211-2/+1
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * systemd/docker.service: fix PATHKir Kolyshkin2018-09-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the PATH to what appears to be the standard on latest Ubuntu (18.04) and Debian (9), fixing the following two issues: 1. PATH did not contain /bin (leading to ContainerTop/ps not working on newer distros, among the other things). 2. $PATH can't be specified in Environment directives in .service files. While at it, also: 3. Remove the comment about RPM as it looks misleading on deb-based systems. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
| * Add `/usr/sbin` to our path variable for systemdEli Uriegas2018-09-171-1/+1
| | | | | | | | | | | | iptables is sometimes placed in `/usr/sbin` Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Remove offline installer to install shim-processEli Uriegas2018-09-101-3/+0
| | | | | | | | | | | | | | | | | | | | Removes the need for the offline installer to install the shim process and instead installs the shim process as part of the packaging. May be easier in the future to just package the shim process on it's own but that'll come after this 18.09 release Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * systemd: set start burst limitsSebastiaan van Stijn2018-08-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229 (https://github.com/systemd/systemd/commit/6bf0f408e4833152197fb38fb10a9989c89f3a59) 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 (https://github.com/systemd/systemd/commit/f0367da7d1a61ad698a55d17b5c28ddce0dc265a) 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>
| * systemd: add support for reloading daemon configuration through systemdSebastiaan van Stijn2018-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * systemd: set systemd KillModeSebastiaan van Stijn2018-08-311-0/+3
| | | | | | | | | | | | | | 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>
| * systemd: add "Delegate=yes" to docker's service fileSebastiaan van Stijn2018-08-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * systemd: don't limit tasksSebastiaan van Stijn2018-08-311-0/+4
| | | | | | | | | | | | | | | | | | | | 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>
| * systemd: set Limit* to infinitySebastiaan van Stijn2018-08-311-0/+4
| | | | | | | | | | | | | | | | | | 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>
| * systemd: no limit on core sizeSebastiaan van Stijn2018-08-311-0/+2
| | | | | | | | | | | | | | 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>
| * Merge pull request #168 from crosbymichael/prestartdocker-unir[bot]2018-08-281-0/+1
| |\ | | | | | | Merged with https://github.com/seemethere/unir
| | * Add post-stopMichael Crosby2018-08-281-0/+1
| | | | | | | | | | | | Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
| * | added RestartSecAndrew Hsu2018-08-281-0/+1
| |/ | | | | | | | | | | Signed-off-by: Andrew Hsu <andrewhsu@docker.com> (cherry picked from commit 51879873897afe298cbb736acef34b5a0b500424) Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
| * Set containerd to be a systemd bind for dockerEli Uriegas2018-08-201-2/+3
| | | | | | | | | | | | The daemon won't actually start without containerd Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Some changes to get this working on CentOS 7Eli Uriegas2018-08-161-3/+1
| | | | | | | | | | | | | | | | Old versions of things on CentOS 7 strike again! infinity is not a thing for TimeoutSec on systemd < 229 Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Revive pre / post steps, update offline locationEli Uriegas2018-08-151-1/+1
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Round out systemd for RPM packagingEli Uriegas2018-08-151-18/+6
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Add systemd files, add containerd-proxy configEli Uriegas2018-08-141-0/+32
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Use internal systemd scripts for DEB packagingEli Uriegas2017-06-062-46/+0
| | | | | | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
| * Add initial systemd scriptsEli Uriegas2017-06-062-0/+46
| | | | Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
* Revert "Add multi-user.target to After="Sebastiaan van Stijn2020-12-101-1/+1
| | | | | | | | This reverts commit 0ca7456e5284d4aa9f3e37e69c7c93eff4420d3d, which caused the docker service to not be starting, or delayed starting the service in certain conditions. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Add multi-user.target to After=Isaiah Grace2020-07-291-1/+1
| | | | | | Add multi-user.target to the After= list in docker.service so that multi-user.target does not wait for docker.service (and consequently wait for network-online.target). Signed-off-by: Isaiah Grace <irgkenya4@gmail.com>
* contrib: remove REVIEWERS filesSebastiaan van Stijn2020-06-242-5/+0
| | | | | | | | We were not really using these, and they haven't been updated in a long time. If needed, we can add people to the CODEOWNERS file. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* run shfmtAkihiro Suda2020-03-033-12/+12
| | | | | | git grep --name-only '^#!' | egrep -v '(vendor|\.go|Jenkinsfile)' | xargs shfmt -w -bn -ci -sr Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* Merge pull request #37470 from harmathy/patch-1Akihiro Suda2020-03-031-1/+0
|\ | | | | Allow socket activation
| * Allow socket activationMax Harmathy2018-07-161-1/+0
| | | | | | | | | | | | PartOf deactivates the socket whenever the service get deactivated. The socket unit however should be active nevertheless. Signed-off-by: Max Harmathy <max.harmathy@web.de>
* | Change docker socket location to /run/docker.sockWiktor Kwapisiewicz2019-05-281-1/+3
| | | | | | | | | | | | | | | | | | | | This change resolves the following systemd warning: ``` /usr/lib/systemd/system/docker.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock → /run/docker.sock; please update the unit file accordingly. ``` Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
* | openrc: Modernize and sync settingsManuel Rüger2019-04-022-7/+17
|/ | | | | | | | | * Use rc_ulimit for ulimit constraints * Synchronize ulimit settings to systemd's * Add support for reload command * Add support for retry settings for docker stop/restart Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* contrib/init/openrc: allow separate logs for stdout and stderrWilliam Hubbs2017-02-232-1/+13
| | | | Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>