pid1: do not reset subtree_control on already-existing units with delegation
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 May 2018 10:19:09 +0000 (12:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Jun 2018 16:12:30 +0000 (18:12 +0200)
commit65be7e06528a221450602bbb3963a8ae0378925b
treeebf39f2c1be3e9708d039415f0649d26d8d10ac5
parentd28b67d46a1f39569231d070f41365b71cc55e8f
pid1: do not reset subtree_control on already-existing units with delegation

Fixes #8364.

Reproducer:
$ sudo systemd-run -t -p Delegate=yes bash
# mkdir /sys/fs/cgroup/system.slice/run-u6958.service/supervisor
# echo $$ > /sys/fs/cgroup/system.slice/run-u6958.service/supervisor/cgroup.procs
# echo +memory > /sys/fs/cgroup/system.slice/run-u6958.service/cgroup.subtree_control
# cat /sys/fs/cgroup/system.slice/run-u6958.service/cgroup.subtree_control
memory
# systemctl daemon-reload
# cat /sys/fs/cgroup/system.slice/run-u6958.service/cgroup.subtree_control
(empty)

With patch, the last command shows 'memory'.
src/basic/cgroup-util.c
src/core/cgroup.c