Systemd/src
Tejun Heo 2977724b09 core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy
Currently the hybrid mode mounts cgroup v2 on /sys/fs/cgroup instead of the v1
name=systemd hierarchy.  While this works fine for systemd itself, it breaks
tools which expect cgroup v1 hierarchy on /sys/fs/cgroup/systemd.

This patch updates the hybrid mode so that it mounts v2 hierarchy on
/sys/fs/cgroup/unified and keeps v1 "name=systemd" hierarchy on
/sys/fs/cgroup/systemd for compatibility.  systemd itself doesn't depend on the
"name=systemd" hierarchy at all.  All operations take place on the v2 hierarchy
as before but the v1 hierarchy is kept in sync so that any tools which expect
it to be there can keep doing so.  This allows systemd to take advantage of
cgroup v2 process management without requiring other tools to be aware of the
hybrid mode.

The hybrid mode is implemented by mapping the special systemd controller to
/sys/fs/cgroup/unified and making the basic cgroup utility operations -
cg_attach(), cg_create(), cg_rmdir() and cg_trim() - also operate on the
/sys/fs/cgroup/systemd hierarchy whenever the cgroup2 hierarchy is updated.

While a bit messy, this will allow dropping complications from using cgroup v1
for process management a lot sooner than otherwise possible which should make
it a net gain in terms of maintainability.

v2: Fixed !cgns breakage reported by @evverx and renamed the unified mount
    point to /sys/fs/cgroup/unified as suggested by @brauner.

v3: chown the compat hierarchy too on delegation.  Suggested by @evverx.

v4: [zj]
- drop the change to default, full "legacy" is still the default.
2017-02-20 12:28:35 -05:00
..
ac-power
activate tree-wide: set SA_RESTART for signal handlers we install 2016-12-01 12:41:17 +01:00
analyze tree-wide: make bus_map_all_properties return a proper sd_bus_error 2017-02-09 16:13:07 +01:00
ask-password
backlight tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
basic core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy 2017-02-20 12:28:35 -05:00
binfmt
boot Revert "Trivial typo fixes and code refactorings (#5191)" 2017-02-01 10:26:50 -05:00
cgls core: simplify cg_[all_]unified() 2017-02-18 17:51:13 -05:00
cgroups-agent tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere 2016-05-05 22:24:36 +02:00
cgtop core: simplify cg_[all_]unified() 2017-02-18 17:51:13 -05:00
core core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy 2017-02-20 12:28:35 -05:00
coredump Merge pull request #5373 from poettering/coredump-timestamp-fixes 2017-02-17 15:23:52 -05:00
cryptsetup Revert "Trivial typo fixes and code refactorings (#5191)" 2017-02-01 10:26:50 -05:00
dbus1-generator Ensure kdbus isn't used (#3501) 2016-06-18 17:24:23 -04:00
debug-generator util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
delta tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853) 2016-12-09 10:04:30 +01:00
detect-virt detect-virt: add --private-users switch to check if a userns is active 2016-10-26 20:12:51 -04:00
dissect core,nspawn,dissect: make nspawn's .roothash file search reusable 2017-02-07 12:21:28 +01:00
escape tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
firstboot copy: change the various copy_xyz() calls to take a unified flags parameter 2017-02-17 10:22:28 +01:00
fsck util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
fstab-generator fstab-generator: quiesce false-positive -Werror=format-nonliteral (#5336) 2017-02-13 20:58:22 -05:00
getty-generator
gpt-auto-generator fs-util: unify code we use to check if dirent's d_name is "." or ".." 2017-02-02 00:06:18 +01:00
hibernate-resume util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
hostname tree-wide: make bus_map_all_properties return a proper sd_bus_error 2017-02-09 16:13:07 +01:00
hwdb hwdb: emit warning when matches are specified at the very end of file 2016-12-11 18:01:26 -05:00
import copy: change the various copy_xyz() calls to take a unified flags parameter 2017-02-17 10:22:28 +01:00
initctl Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
journal journalctl: add reference to sd-id128(3) to output (#5382) 2017-02-18 16:36:25 -05:00
journal-remote Move export format parsing from src/journal-remote/ to src/basic/ 2017-02-14 23:56:48 -05:00
kernel-install kernel-install: avoid process substitution 2017-01-11 15:34:54 -05:00
libsystemd core: simplify cg_[all_]unified() 2017-02-18 17:51:13 -05:00
libsystemd-network libsystemd-network: ipv4ll probe conflict counter (#5361) 2017-02-16 11:14:38 +01:00
libudev udev-event: use in-place whitespace replacement 2017-01-27 07:58:00 -05:00
locale tree-wide: make bus_map_all_properties return a proper sd_bus_error 2017-02-09 16:13:07 +01:00
login tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
machine machined: refuse bind mounts on containers that have user namespaces applied 2017-02-17 10:22:28 +01:00
machine-id-setup machine-id-setup: `--print --commit` respects the --root option 2016-12-13 13:03:13 +00:00
modules-load util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
mount systemd-mount: add missing fsck argument (#5238) 2017-02-06 14:25:15 +01:00
network network: change condition in if testing section presence 2017-02-17 09:34:25 -05:00
notify Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
nspawn core: make hybrid cgroup unified mode keep compat /sys/fs/cgroup/systemd hierarchy 2017-02-20 12:28:35 -05:00
nss-myhostname nss: fix error to ERANGE for nss calls with too little buffer space (#5365) 2017-02-16 21:29:09 +01:00
nss-mymachines nss: fix error to ERANGE for nss calls with too little buffer space (#5365) 2017-02-16 21:29:09 +01:00
nss-resolve nss-resolve: Fix assertion in ifindex_to_scopeid. (#5360) 2017-02-16 11:00:49 +01:00
nss-systemd nss: fix error to ERANGE for nss calls with too little buffer space (#5365) 2017-02-16 21:29:09 +01:00
path
quotacheck qutoacheck,gpt-auto-generator: trivial coding style improvements 2016-12-21 19:09:28 +01:00
random-seed
rc-local-generator tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
remount-fs tree-wide: always invoke setmntent() with "re" mode 2016-12-20 20:00:09 +01:00
reply-password treewide: replace homegrown memory_erase with explicit_bzero 2017-02-05 21:07:55 -05:00
resolve Merge pull request #5347 from poettering/local-nta 2017-02-17 15:00:36 -05:00
rfkill tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
run tree-wide: make bus_map_all_properties return a proper sd_bus_error 2017-02-09 16:13:07 +01:00
shared systemctl: show extra args if defined (#5379) 2017-02-17 15:27:45 -05:00
sleep tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
socket-proxy socket-proxyd: fix --connections-max help message and docs (#5044) 2017-01-10 08:55:50 +01:00
stdio-bridge
sysctl sysctl: minor simplification 2016-11-02 11:39:48 -06:00
system-update-generator system-update-generator: warn if the command line blocks updates (#5173) 2017-02-01 21:50:03 +01:00
systemctl copy: change the various copy_xyz() calls to take a unified flags parameter 2017-02-17 10:22:28 +01:00
systemd tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
sysusers copy: change the various copy_xyz() calls to take a unified flags parameter 2017-02-17 10:22:28 +01:00
sysv-generator sysv-generator: properly translate sysv facilities 2016-12-14 18:29:30 +01:00
test test: re-drop assumption that /run is a mount point (#5377) 2017-02-17 15:29:02 -05:00
timedate tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
timesync build-sys: add check for gperf lookup function signature (#5055) 2017-01-10 08:39:05 +01:00
tmpfiles machined: when copying files from/to userns containers chown to root 2017-02-17 10:22:28 +01:00
tty-ask-password-agent treewide: replace homegrown memory_erase with explicit_bzero 2017-02-05 21:07:55 -05:00
udev Merge pull request #5373 from poettering/coredump-timestamp-fixes 2017-02-17 15:23:52 -05:00
update-done update-done: minor clean-ups 2016-10-24 17:29:51 +02:00
update-utmp Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
user-sessions
vconsole Merge pull request #4448 from msoltyspl/vcfix 2016-10-26 20:55:18 -04:00
veritysetup tree-wide: remove consecutive duplicate words in comments (#5148) 2017-01-24 21:45:30 -05:00
volatile-root fstab-generator: add support for volatile boots 2016-12-21 19:09:29 +01:00
.gitignore
Makefile