Systemd/src
Tejun Heo bd15ab41a1 nspawn: fix cgroup mode detection
cgroup mode detection is broken in two different ways.

* detect_unified_cgroup_hierarchy() is called too nested in outer_child().
  sync_cgroup() which is used by run() also needs to know the requested cgroup
  mode but it's currently always getting CGROUP_UNIFIED_UNKNOWN.  This makes it
  skip syncing the inner cgroup hierarchy on some config combinations.

   $ cat /proc/self/cgroup | grep systemd
   1:name=systemd:/user.slice/user-0.slice/session-c1.scope

   $ UNIFIED_CGROUP_HIERARCHY=0 SYSTEMD_NSPAWN_USE_CGNS=0 systemd-nspawn -M container
   ...
   [root@container ~]# cat /proc/self/cgroup | grep systemd
   1:name=systemd:/machine.slice/machine-container.x86_64.scope
   $ exit

   $ UNIFIED_CGROUP_HIERARCHY=1 SYSTEMD_NSPAWN_USE_CGNS=0 systemd-nspawn -M container
   [root@container ~]# cat /proc/self/cgroup | grep 0::
   0::/
   $ exit

  Note how the unified hierarchy case's path is not synchronized with the host.
  This for example can cause issues when there are multiple such containers.

  Fixed by moving detect_unified_cgroup_hierarchy() invocation to main().

* inner_child() was invoking cg_unified_flush().  inner_child() executes fully
  scoped and can't determine which cgroup mode the host was in.  It doesn't
  make sense to keep flushing the detected mode when the host mode can't
  change.

  Fixed by replacing cg_unified_flush() invocations in outer_child() and
  inner_child() with one in main().
2017-02-18 17:49:06 -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 missing: add renameat2() definition for 64bit arm (#5378) 2017-02-17 13:10:09 -05:00
binfmt
boot Revert "Trivial typo fixes and code refactorings (#5191)" 2017-02-01 10:26:50 -05:00
cgls cgls: look at the right variable in error path (#5234) 2017-02-06 13:34:01 +01:00
cgroups-agent tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere 2016-05-05 22:24:36 +02:00
cgtop cgtop: use common function to query cgroup root 2017-02-01 20:29:09 -05:00
core Merge pull request #5333 from poettering/machined-copy-files-userns 2017-02-17 13:51:58 +01: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 sd-event: "when exiting no signal event are pending" is a wrong assertion (#5271) 2017-02-08 20:56:22 +01: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 nspawn: fix cgroup mode detection 2017-02-18 17:49:06 -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