Commit Graph

107 Commits

Author SHA1 Message Date
c730591115 contrib/init/openrc: allow separate logs for stdout and stderr
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Upstream-commit: 65c1a3be5bf748f95edc45f1391c869bf4ff4a52
Component: engine
2017-02-23 17:07:26 -06:00
720dd28131 Merge pull request #30210 from thaJeztah/carry-29727
[carry 29727] update unit-file; wait for network to be online
Upstream-commit: ea4d1243953e6b652082305a9c3cda8656edab26
Component: engine
2017-02-03 17:17:08 -08:00
44e3cd82ba Update systemd drop-in link
Right now it redirects, so change it to the correct one.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 7c763b360a08f9a079fd041cbe38ab71efc3cd11
Component: engine
2017-01-31 12:31:00 -05:00
11927179d9 bugfix issie 18826: containers do not restart after reboot when bound to virtual network interface
Signed-off-by: Dmitry Kononenko <d@dm42.ru>
Upstream-commit: dfa4e77d8202f5c682056b59be3111eccddfb09a
Component: engine
2017-01-17 14:05:54 +01:00
857c35324a Add on-failure to default restart policy
In the event that the docker daemon is managed by systemd and spontaneously
dies the default service configuration does not have docker restart. For people
who just want to install and start docker then never worry about whether docker
is running a better default may be to restart the service on a failure.

Signed-off-by: Ryan Abrams <rdabrams@gmail.com>
Upstream-commit: 7b9ecb9700ebd90c7f5854028f0f981f0fe5d03a
Component: engine
2017-01-06 10:23:44 -08:00
796e3c3730 Stop returns 0 when docker service was not running
In case when docker was not running init script stop was returning value <> 0.
Due to this fact it was impossible to uninstall the docker-engine if the docker service was stopped.

Signed-off-by: Cyprian Gracz <cyprian.gracz@micro-jumbo.eu>

Fixed message logging

Signed-off-by: Cyprian Gracz <cyprian.gracz@micro-jumbo.eu>
Upstream-commit: 74cf6157ef0d8788a56aed65a85b722ccb50e398
Component: engine
2016-11-28 12:27:21 +01:00
2f475c1229 Change TMPDIR to DOCKER_TMPDIR
TMPDIR was changed to DOCKER_TMPDIR in pull request 7113 but the file still asks user to set TMPDIR.
I am new to docker and wasted sometime this morning because of this.
I am using docker version 1.12.1 on ubuntu server 14.04

Signed-off-by: Neyazul Haque <nuhaque@gmail.com>
Upstream-commit: 10cebd4c741cd9e0762227148795c4ce02317579
Component: engine
2016-08-23 08:45:46 +05:30
d3f9e431a9 missed DOCKER->DOCKERD change in 1ac1b78b3a771c562d9cfa91c14f8a494c3723c1 for 'status'
Signed-off-by: Liam Macgillavry <liam@kumina.nl>
Upstream-commit: 11eda60848e476c3a1d84a035642edba74e94c8a
Component: engine
2016-08-19 11:08:52 +02:00
5b967c9349 deal with firewalld/docker startup issues
added the firewalld.service symbol in the After line docker
will always start after firewalld, thus eliminating the issue
of firewall blocking all mapped traffic.

Signed-off-by: Ramon Brooker <Ramon.Brooker@imaginecommunications.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 73e08286f920881a431fa7befd3909e72303680b
Component: engine
2016-08-11 00:13:33 +02:00
9111a66ef5 Use the name of the first unix socket in DOCKER_OPTS
Otherwise the while loop waits forever, checking for
a filename made up of all the names.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Upstream-commit: 68dab9bd0910e22c96d5dfcbd4e972f8ce770a88
Component: engine
2016-07-29 14:04:43 +01:00
3ee2799172 Merge pull request #24555 from thaJeztah/to-infinity-and-beyond
Don't set ulimits (nproc) for all init scripts
Upstream-commit: 4084bf7ad23f1c82601e4cbcc2d224c3bc7e0b12
Component: engine
2016-07-28 16:48:16 -07:00
08e3e00d23 Remove the Require on the socket for the rpm
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 3cddda3bbb0cbc6f600b228b61e1110e0cf34c65
Component: engine
2016-07-26 14:56:27 -07:00
02e14246d7 Remove docker.socket from rpm based systems
Fixes #23981

The selinux issue we are seeing in the report is related to the socket
file for docker and nothing else. By removing the socket docker starts
up correctly.

However, there is another motivation for removing socket activation from
docker's systemd files and that is because when you have daemons running
with --restart always whenever you have a host reboot those daemons
will not be started again because the docker daemon is not started by
systemd until a request comes into the docker API.

Leave it for deb based systems because everything is working correctly
for both socket activation and starting normally at boot.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 04104c3a1e6cad30cb41b762e8832215466c0e95
Component: engine
2016-07-19 09:31:43 -07:00
8e4507da93 Change $prog back to docker in sysvinit-redhat
(and set $exec to dockerd instead)

This ensures end users do not need to make any configuration changes
due to the rename from docker to dockerd in version 1.12.

Signed-off-by: Paul Furtado <pfurtado@hubspot.com>
Upstream-commit: acb41ddc9df80894d2ff84c34a98cc904b9241fa
Component: engine
2016-07-14 17:21:59 -04:00
c1870c571b Don't set ulimits (nproc)
There is a not-insignificant performance overhead for all containers (if
containerd is a child of Docker, which is the current setup) if rlimits are
set on the main Docker daemon process (because the limits
propogate to all children).

We recommend using cgroups to do container-local accounting.

This applies the change added in 8db61095a3d0bcb0733580734ba5d54bc27a614d
to other init scripts.

Note that nfile cannot be set to unlimited, and the limit
is hardcoded to 1048576 (2^20) , see:
http://stackoverflow.com/a/1213069/1811501

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 428d7337e808ec5f4dba1b0aceda002f295cc320
Component: engine
2016-07-13 17:15:19 +02:00
b9f07879e0 use tabs for indentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fa077f74969b2c11f1ccfb4c5777c98b5e123013
Component: engine
2016-07-12 23:16:55 +02:00
ec59bad07c contrib: systemd: set Limit* to infinity
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: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 8db61095a3d0bcb0733580734ba5d54bc27a614d
Component: engine
2016-07-04 23:00:28 +10:00
55c05646ce Set systemd KillMode
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: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: db435f526ac5703276ad1add28188c0c8c6e4c2a
Component: engine
2016-06-16 11:46:04 -07:00
9f585ffb3f Remove MountFlags in systemd unit to allow shared mount propagation
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
Upstream-commit: 2aee081cad72352f8b0c37ba0414ebc925b022e8
Component: engine
2016-05-24 12:51:31 +01:00
97e6cef981 contrib: init: use dockerd
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 1ac1b78b3a771c562d9cfa91c14f8a494c3723c1
Component: engine
2016-05-11 11:00:11 +02:00
490a37a62f 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>
Upstream-commit: f74b856e1ac2805fe48ceb52bc83cd7a3cec870c
Component: engine
2016-05-02 10:27:07 +02:00
ee66cdf051 docker.service: don't limit tasks
Signed-off-by: Pierre Carrier <pierre@meteor.com>
Upstream-commit: 33a8ab29ed9e51697772a0642b8d651b9a845532
Component: engine
2016-03-27 04:02:34 -07:00
48da675c58 Add "Delegate=yes" to docker's service file
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 #20152

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: d16737f971092767c1b9d28302a3f5aedbe2f576
Component: engine
2016-02-25 10:32:09 -08:00
a5ddabd8b8 remove tasksmax, people on newer kernels can add it themselves
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 624125082414d5ba4a987657a44a8506920da611
Component: engine
2016-02-09 14:07:23 -08:00
a2042aca33 Merge pull request #19886 from AndrewGuenther/185160-init-socket-fix
Wait to fire start event until socket is created
Upstream-commit: d47812dd1d1de206e29a644e125a0a0f28655c6c
Component: engine
2016-02-03 17:38:52 -08:00
fb14e6604b Allow disabling of colored Docker logs via daemon flag.
Signed-off-by: Vincent Woo <me@vincentwoo.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 87a450a37f0e934b67c90fbcdbff28459216e332
Component: engine
2016-02-01 16:19:18 -05:00
65de1378f5 Wait to fire start event until socket is created
Previously, this check only worked if no host was specified and was
hard coded to check for "/var/run/docker.sock"

This change generalizes that check and captures any specified socket
and waits for it to be created.

Caveat: This will only check the first socket specified, but it is an
improvement over none at all.

Fixes #185160

Signed-off-by: Andrew Guenther <guenther.andrew.j@gmail.com>
Upstream-commit: 9f401254bd8e097ef30a3bc5de5576de08bc979a
Component: engine
2016-02-01 08:40:26 -08:00
69dd6d149a Add a note to /etc/default/docker noting that it does not apply to systemd
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 90e33640b883134be0fc7d526d2ba45aa6eef70f
Component: engine
2016-01-22 07:35:02 -08:00
b8f7499a3b Set TasksMax in addition to LimitNPROC in systemd service files
systemd sets an additional limit on processes and threads that defaults to 512 when run under Linux >= 4.3.
See more information here: http://unix.stackexchange.com/a/255603/59955

Signed-off-by: Candid Dauth <cdauth@cdauth.eu>
Upstream-commit: 105778343a2e5d510fae1cbdb1b7ab6879e5a028
Component: engine
2016-01-16 18:45:41 +01:00
02f28288ea Fix syntax error in init script
Signed-off-by: oyld <oyld0210@163.com>
Upstream-commit: bbbc01b86edf9a5676ad735d008097942e0a93ac
Component: engine
2015-12-22 04:00:00 -08:00
bceb4f3dff Disable timeout for systemd
With content addressability update starting upgraded
daemon for the first time can take a long time if
graph dir was not prepared with a migration tool before.
This avoids systemd timeouts while the migration is
taking place.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: eff5e6498fa424587c339b5ae54e28f003775e4b
Component: engine
2015-12-03 13:15:31 -08:00
266b690d59 Update upstart init script to start on filesystem (not only on local ones).
Signed-off-by: Julien Pervillé <julien.perville@perfect-memory.com>
Upstream-commit: 6f83dd22a36b57fdc75bd2b6cbce7572b0695f99
Component: engine
2015-11-05 20:38:52 +01:00
b32a8c3c1d #16560 Add timeout to sudo service docker stop on sysvinit
Add 10 seconds timeout when running `sudo service docker stop`. This is
especially needed when running `sudo service docker restart`. Otherwise,
`restart` results in exitstatus 1, because `start` has nothing to do.

Signed-off-by: Ewa Czechowska <ewa@ai-traders.com>
Upstream-commit: 5c94a9e800ed4f2e43f472b214f699c22fd7e2fe
Component: engine
2015-09-24 19:41:32 +00:00
871fe73c24 Do not try to guess "docker" in Debian SysV init script
On boot, the init script is invoked from `/etc/rcN.d/S20docker` (where N
is the runlevel). Consequently, the init script tried to find the
defaults at `/etc/defaults/S20docker` and the binary at
`/usr/bin/S20docker`. This causes the docker daemon to fail at boot with
the error

    /usr/bin/S20docker not present or not executable

Starting it manually works because it invokes `/etc/init.d/docker` which
has the correct basename.

Fix this by hardcoding "docker" as the base name.

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
Upstream-commit: 01c5cfcc5629e1d90a50a8447f9712fa6ff49f48
Component: engine
2015-09-23 11:27:34 +00:00
b6051b4d2b Fix OpenRC init script
The shebang for OpenRC init scripts is now #!/sbin/openrc-run, and we
can also use the default start and stop functions built into OpenRC.

Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Upstream-commit: e3772538c0eb5c1478075979d222485cb3bd8c91
Component: engine
2015-08-25 12:02:01 -05:00
ba5891cb58 Drop execute bit from openrc init script
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Upstream-commit: 1c0c68b18fe3a32f3e9915c3bf6ae50b69fee288
Component: engine
2015-08-25 12:00:54 -05:00
2bf0729522 Merge pull request #14868 from jeffminard-ck/rhel-init-detect-failure
Allow RHEL init script to detect daemon start pid failure
Upstream-commit: ebe27cb34ca5e91173b004e2602c99704350eb7c
Component: engine
2015-08-24 14:24:36 -07:00
dfdfccc5a6 Fix silent failure in RedHat sysvinit script
The docker script in contrib/init/sysvinit-redhat will fail silently on
a start if Docker is not installed in the default /usr/bin/ location.
While a non-zero exit code is returned the user will receive no visible
indication (i.e. error message) as to why Docker was not started.

This commit changes the logic so that in the case that the docker
executable is not found in the expected location or the user does not
have execute permissions on the executable appropriate error messages
are now shown to the user as well as exiting with a non-zero exit code

Signed-off-by: Rob Vesse <rvesse@dotnetrdf.org>
Upstream-commit: f8387f69042b222e5b0a5d91cf49a840e345f88d
Component: engine
2015-08-06 12:07:38 +01:00
8f4ab799ef systemd: set service type to notify.
Currently the service type is 'simple', the default, meaning that
docker.service is considered to be started straight after
spawning. This is incorrect as there is significant amount of time
between spawning and docker ready to accept connections on the passed
sockets. Docker does implement systemd socket activate and
notification protocol, and send the ready signal to systemd, once it
is ready. However for systemd to take those notifications into
account, the service file type should be set to notify.

Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Upstream-commit: d3e5179c291a7646c71f1ca608d6700026756f7c
Component: engine
2015-07-29 14:02:12 +01:00
5b6d4b1770 Allow RHEL init script to detect daemon start pid failure
If you have some kind of bogus `other_args` in `/etc/sysconfig/docker` the start script will report "started" but it's full of lies. This enhances the flow so that if the pidfile never shows up (failure to start) you get a proper failure message.

I also added dots for fun.

Signed-off-by: Jeff Minard <jeff.minard@creditkarma.com>
Upstream-commit: 6f8fdb8aa893b2d5f319d342614dd159e0c8bb83
Component: engine
2015-07-22 11:36:34 -07:00
45caf3ce23 Update init scripts to use docker daemon.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 346ce4f8d24de0db5ccc17151f2207cee10abc2e
Component: engine
2015-07-22 11:24:38 -07:00
974ab12463 Revert "contrib/init: unshare mount namespace for inits"
This reverts commit b6569b6b82df4c5e29ee8f5ebd9db7e36919cefd.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: d8592eaff8bddb6f29c48cc39dec70db884eda00
Component: engine
2015-06-15 10:35:17 -07:00
2c15e96c15 Fix docs URL in systemd service file.
Fixes #13799.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
Upstream-commit: dbf5e36fd6257ed237f76a65ccbae4124a4f0bdf
Component: engine
2015-06-08 10:21:43 +00:00
0faed528d2 Merge pull request #13039 from stevenbrichards/13031-Upstart
Fix check for upstart not detecting properly
Upstream-commit: 0256bbdebbc2fa7911c6e12bfae488fab7b30301
Component: engine
2015-05-28 10:38:55 -07:00
5dd5db33a8 Fixes #13031 - Check for upstart or init is not detecting properly
This will now properly check whether /etc/init.d/docker or service docker is
invoking the script and respond to the user accordingly.

Signed-off-by: Steven Richards <steven@axiomzen.co>
Upstream-commit: e5ff643aed78fb5dfb5e3fef518dfe56b82b3023
Component: engine
2015-05-28 09:52:05 -07:00
f3325976cc Increase upstart kill timeout to 20 seconds
Give Docker more time to kill containers before upstart kills Docker.
The default kill timeout is 5 seconds.
This will help decrease the chance of but not eliminate the chance of
orphaned container processes.

Signed-off-by: David Xia <dxia@spotify.com>
Upstream-commit: 2f9e7a067a7273a0f344c1c9a6397e4bb61d7554
Component: engine
2015-05-20 14:20:46 -04:00
961f3662e8 contrib/init: unshare mount namespace for inits
* openrc
* sysvinit-debian
* upstart

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: b6569b6b82df4c5e29ee8f5ebd9db7e36919cefd
Component: engine
2015-04-23 14:08:37 -04:00
e5cca0d2d7 Prevent Upstart post-start stanza from hanging
Once the job has failed and is respawned, the status becomes `docker
respawn/post-start` after subsequent failures (as opposed to `docker
stop/post-start`), so the post-start script needs to take this into
account.

I could not find specific documentation on the job transitioning to the
`respawn/post-start` state, but this was observed on Ubuntu 14.04.2.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Upstream-commit: 302e3834a0bfa860f9d06b42a2955b0cbd135c38
Component: engine
2015-03-31 01:56:16 +01:00
d4497c7a2b .: remove trailing white spaces
blame tibor this one ;-)
```
find . -type f -not -name '*.png' -not -name '*.go' -not -name '*.md'
-not -name '*.tar' -not -name '*.pem' -not -path './vendor/*' -not -path
'./.git/*' -not -path '*/testdata/*' -not -path './docs/*images*' -not
-path '*/testfiles/*' -not -path './bundles/*' -not -path
'./docs/*static*/*' -not -path './docs/*article-img/*' -exec grep -HnEl
'[[:space:]]$' {} \; | xargs sed -iE 's/[[:space:]]*$//'
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 7617ec176d266650b19c2378ccab4aa41e6dc5a2
Component: engine
2015-03-25 13:38:17 -04:00
abd71318ca Revert "Dealing with trailing whitespaces"
The validation script from #10681 is too pedantic, and does not handle
well situations like:

```
cat <<EOF   # or <<-EOF
	Whether the leading whitespace is stripped out or not by bash
	it should still be considered as valid.
EOF
```

This reverts commit 4e65c1c319afffc325853b88c9aef0c42ec83482.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 0252ad0adc37a34b88fa908ae74a13b940febdcb
Component: engine
2015-03-25 10:04:56 -06:00