Commit Graph

43 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
2989e6a633 no limit on core size
set LimitCORE=infinity to ensure complete core creation,
allows extraction of as much information as possible.

Thanks to Ulrich Obergfell <uobergfe@redhat.com>
and Jeremy Eder <jeder@redhat.com>

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
Upstream-commit: ae9cdbbde7824951b124a648e897ac4c291108e3
Component: engine
2015-02-09 19:04:50 +00:00
89ba84c840 contrib/systemd: mount namespace and subtree flags
This systemd.exec setting will construct a new mount namespace for the
docker daemon, and use slave shared-subtree mounts so that volume mounts
propogate correctly into containers.

By having an unshared mount namespace for the daemon it ensures that
mount references are not held by other pids outside of the docker
daemon. Frequently this can be seen in EBUSY or "device or resource
busy" errors.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: eb76cb2301fc883941bc4ca2d9ebc3a486ab8e0a
Component: engine
2015-01-20 14:22:04 -05:00
54a35eb340 Merge pull request #8198 from jfrazelle/add-jessie-to-various-maintainers
Adding self to various maintainers files.
Upstream-commit: f0327c99dd6fb7353d76726e0adb67a1b5a98451
Component: engine
2014-10-28 19:35:28 -07:00
4a5c5e00b6 Fix system socket/service unit files
Two problems how they are today:

In the current systemd unit files it is impossible to have the
docker.service started at system boot.  Instead enableing docker.service
will actually enable docker.socket.  This is a problem, as that means
any container with --restart=always will not launch on reboot.  And of
course as soon as you log in and type docker ps, docker.service will be
launched and now your images are running.  Talk about a PITA to debug!
The fix is to just install docker.service when people ask docker.service
to be enabled.  If an admin wants to enable docker.socket instead, that
is fine and will work just as it does today.

The second problem is a common docker devel workflow, although not
something normal admins would hit.  In this case consider a dev doing
the following:

systemctl stop docker.service

docker -d
[run commands]
[^C]

systemctl start docker.service

Running docker -d (without -F fd://) will clean up the
/var/run/docker.sock when it exits.  Remember, you just ran the docker
daemon not telling it about socket actviation, so cleaning up its socket
makes sense!  The new docker, started by systemd will expect socket
activation, but the last one cleaned up the docker.sock.  So things are
just broken.  You can, today, work around this by restarting
docker.socket.  This fixes it by telling docker.socket that it is
PartOf=docker.service.  So when docker.service is
started/stopped/restarted docker.socket will also be
started/stopped/restarted.  So the above semi-common devel workflow will
be fine.  When docker.service is stopped, so is docker.socket,   docker
-d (without -F fd://) will create and delete /var/run/docker.sock.
Starting docker.service again will restart docker.socket, which will
create the file an all is happy in the word.

Signed-off-by: Eric Paris <eparis@redhat.com>
Upstream-commit: 053c3557b3198466ecfbe066fefdbab2a78771d5
Component: engine
2014-10-07 14:09:08 -04:00
8734c910c3 Adding self to various maintainers files.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6c60e8c7849742c111a2b0a5ad4ff88fc8e960ef
Component: engine
2014-09-29 15:43:07 -07:00
4569bccd5e Systemd service should not restart on failure
This should not be done by default but used by adminsys with a drop-in.d file,
for buggy daemons which crash without known fixes.

Docker-DCO-1.1-Signed-off-by: Sébastien Luttringer <seblu@seblu.net> (github: seblu)
Upstream-commit: 533916fa6bb0b19fb887b5b0b2b704b224154b41
Component: engine
2014-07-28 11:50:24 +02:00
d687489711 Systemd .service should install .socket
And remove the WantedBy directive.

See: https://bugs.archlinux.org/task/41338

Docker-DCO-1.1-Signed-off-by: Sébastien Luttringer <seblu@seblu.net> (github: seblu)
Upstream-commit: 0f26195a8ddd0bde95865816576d827a9ed0727c
Component: engine
2014-07-28 00:18:14 +02:00
e1fb484158 Fix ordering in systemd service file
See: https://bugs.archlinux.org/task/41338

Docker-DCO-1.1-Signed-off-by: Sébastien Luttringer <seblu@seblu.net> (github: seblu)
Upstream-commit: fe68df36fc9c85ae30af9bf53a13e8af0534e613
Component: engine
2014-07-28 00:17:40 +02:00
554507d5b7 contrib/init/systemd: add philips as MAINTAINER
As requested after #7021 add me as a maintainer alongside the sword
toting @lsm5.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 81307680142d5ddd8e80c70c5da8afc799318556
Component: engine
2014-07-17 11:57:16 -07:00
927ac2785f systemd unitfile requires docker.socket
modified:   contrib/init/systemd/docker.service

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> (github: lsm5)
Upstream-commit: 0bde827c3f01fc5ae99eb0b93170e75c99cd5d77
Component: engine
2014-07-14 18:08:38 -05:00
e091331e86 use systemd socket-activation by default
modified:   contrib/init/systemd/docker.service
	renamed:    contrib/init/systemd/socket-activation/docker.socket -> contrib/init/systemd/docker.socket
	deleted:    contrib/init/systemd/socket-activation/docker.service

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> (github: lsm5)
Upstream-commit: 076ac1d7d212c3a81a401a2fba8b9965bc26df16
Component: engine
2014-07-14 17:41:07 -05:00
5901c9dd26 add systemd MAINTAINERS file
new file:   contrib/init/systemd/MAINTAINERS

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> (github: lsm5)
Upstream-commit: 5105981431def23a7424a0c0c09095d815243ea9
Component: engine
2014-07-14 17:38:23 -05:00
9eda104cfe Fix the systemd socket activation socket permissions
Fixes #6836

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 3589f5b9c2d9e5cb6d057713aa8d591295c5f523
Component: engine
2014-07-07 08:09:25 -06:00
c8806a50df I'm going to wish I didn't do this
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: fa29b1f062d25c1a8ca62f02b9cc7533df4c7449
Component: engine
2014-07-03 10:31:56 +10:00
ecc13ba924 bump open files and procs limit via unitfile
Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)

	modified:   contrib/init/systemd/docker.service
	modified:   contrib/init/systemd/socket-activation/docker.service
Upstream-commit: 291d5e642e83ca84bd4f9b470eac8f840fecf48c
Component: engine
2014-03-04 22:29:51 -05:00
0e8d28d6ec contrib: systemd: make socket-activation Restart=always
Do as was done to f09a78cd219b24d4308034c8dd13410cfe5fbec7 in the
socket-activation example.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 4dab34c2045b7bcc735227867126f0796cbb09c1
Component: engine
2014-01-29 17:42:32 -08:00
667c92d38b remove ip fowarding from systemd (fixed: commit #3801)
Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)
Upstream-commit: a9d0bbcfc6e45817f39f15a7c9b11305b4c04bad
Component: engine
2014-01-29 11:06:23 -05:00
5e880285ec ExecStartPre commands updated
Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)

systemd service no longer does '/bin/mount/ --make-rprivate /'.
Core issue fixed by Alex Larsson (commit 157d99a).

ip forwarding enabled.
Upstream-commit: f09a78cd219b24d4308034c8dd13410cfe5fbec7
Component: engine
2014-01-29 11:06:23 -05:00
e0523eee43 fix(contrib/init/systemd): remove mount rprivate
Docker does this now via 157d99a72786c454dfaad8b0800914cc80879aa8

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 1f44921c51883e923ed82ed4e30eca6f79702cfb
Component: engine
2014-01-27 17:18:09 -08:00
7f4461fb98 Allow fd:// like unix:// and tcp://
Somthing like 20605eb310f0b57bd06eea80ec63c5022fc83bde

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 7f9d3268bf0e1d4a79d07c67e22eb14d3de96f6c
Component: engine
2014-01-27 17:18:09 -08:00
93246312a1 server: add socket activation
This adds the ability to socket activate docker by passing in
`-H fd://*` along with examples systemd configuration files.

The fastest way to test this is to run:

```
/usr/lib/systemd/systemd-activate -l 127.0.0.1:2001 /usr/bin/docker -d -H 'fd://*'
docker -H tcp://127.0.0.1:2001 ps
```

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 87fb2c973d8f9a8a1868ab0c2da504095d04715b
Component: engine
2014-01-27 17:17:07 -08:00
8a1ed2b1a2 Update systemd service file with suggestions from @seblu
Upstream-commit: 75e9cff98ce585ccd050a4014adb99d95509c9b7
Component: engine
2013-11-27 16:55:37 -07:00
9053b11b66 fix(systemd): provide a better description
Fix-up the docker service file description to declare what the service is not what it does.

When a systemd machine starts up the Description of each unit scrolls by instead of the service's filename. Because the current description doesn't say what it is it isn't very friendly:

```
Oct 31 20:40:49 localhost systemd[1]: Started Update Engine.
Oct 31 20:40:49 localhost systemd[1]: Starting Multi-User System.
Oct 31 20:40:49 localhost systemd[1]: Reached target Multi-User System.
Oct 31 20:40:49 localhost systemd[1]: Starting Easily create lightweight, portable, self-sufficient containers from any application!...
Oct 31 20:40:49 localhost systemd[1]: Started Easily create lightweight, portable, self-sufficient containers from any application!.
```
Upstream-commit: 393562340c6f386a837eac9a616c456dc54faa4f
Component: engine
2013-10-31 14:41:49 -07:00
82851ecb8f Add initial init scripts library, including systemd, sysvinit, upstart, and openrc
Upstream-commit: c405d53b6e6658b1cbe9ad7ba52ea6dc9330f546
Component: engine
2013-10-17 12:03:49 -06:00