runc/cgroups
Brandon Philips 99233fde8c cgroups: systemd: set DefaultDependencies=false if possible
The root problem this fixes is the docker daemon uses DefaulDependencies
for all of its scopes which means that the containers get killed by
systemd before the docker daemon is notified to shutdown. This means
that a docker run in a service file won't get ordered properly on
shutdown! This has affected many CoreOS users and is documented in
systemd as so:

"Unless DefaultDependencies=false is used, scope units will implicitly
have dependencies of type Conflicts= and Before= on shutdown.target."

Unfortunately, systemd didn't allow setting DefaultDependencies=false on
transient units until today:

    systemd-run --scope --property="DefaultDependencies=false" /usr/bin/sleep 50000
    Unknown assignment DefaultDependencies=false.
    Failed to create message: Invalid argument

Fixed here:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=261420ba2a20305ad271b6f5f380aa74c5c9dd50

Discussion with systemd upstream:
http://lists.freedesktop.org/archives/systemd-devel/2014-December/026313.html
http://lists.freedesktop.org/archives/systemd-devel/2015-February/027890.html

Tested with docker and systemd master as of today and it work for me.

Signed-off-by: Brandon Philips <brandon.philips@coreos.com>
2015-02-03 22:25:27 -05:00
..
fs Merge pull request #337 from hqhq/hq_add_blkio_weight 2015-01-20 10:40:12 -08:00
systemd cgroups: systemd: set DefaultDependencies=false if possible 2015-02-03 22:25:27 -05:00
cgroups.go add support for blkio.weight 2015-01-19 14:33:48 +08:00
cgroups_test.go pkg/cgroups: Export ParseCgroupFile 2014-10-07 15:55:58 +02:00
stats.go Fix typo in json tag 2014-11-11 23:34:55 +00:00
utils.go Don't get stats for cgroups that don't exist. 2015-01-08 11:17:09 -08:00