Bug#803013: systemd should not destroy application created cgroups
paul.szabo at sydney.edu.au
paul.szabo at sydney.edu.au
Thu Oct 29 19:16:38 GMT 2015
Dear Martin,
>> # Set things up
>> mkdir /sys/fs/cgroup/cpu/mytest
>> echo $$ > /sys/fs/cgroup/cpu/mytest/tasks
>> # Check it is there
>> grep . /sys/fs/cgroup/cpu/mytest/tasks
>> # Do the systemd thing
>> systemctl daemon-reload
>> systemctl start anacron
>> # See it gone
>> grep . /sys/fs/cgroup/cpu/mytest/tasks
>
> FTR, I was testing this in a jessie VM now, and I can't reproduce the
> cgroup changes there either. So this is more subtle to reproduce.
Thanks for testing. However, the test "works" for me on jessie:
root at p639:~# COLUMNS=120 dpkg -l | grep systemd
ii libpam-systemd:amd64 215-17+deb8u2 amd64 system and service manager - PAM module
ii libsystemd-daemon0:amd64 215-17+deb8u2 amd64 systemd utility library (deprecated)
ii libsystemd-login0:amd64 215-17+deb8u2 amd64 systemd login utility library (deprecated)
ii libsystemd0:amd64 215-17+deb8u2 amd64 systemd utility library
ii systemd 215-17+deb8u2 amd64 system and service manager
ii systemd-sysv 215-17+deb8u2 amd64 system and service manager - SysV links
root at p639:~# mkdir /sys/fs/cgroup/cpu/mytest
mkdir: cannot create directory ?/sys/fs/cgroup/cpu/mytest?: File exists
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
root at p639:~# echo $$ > /sys/fs/cgroup/cpu/mytest/tasks
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
7198
root at p639:~# systemctl daemon-reload
root at p639:~# systemctl start anacron
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
root at p639:~#
and the issue is fixed with my patch:
root at p639:~# COLUMNS=120 dpkg -l | grep systemd
ii libpam-systemd:amd64 215-17+deb8u2.psz amd64 system and service manager - PAM module
ii libsystemd-daemon0:amd64 215-17+deb8u2 amd64 systemd utility library (deprecated)
ii libsystemd-login0:amd64 215-17+deb8u2 amd64 systemd login utility library (deprecated)
ii libsystemd0:amd64 215-17+deb8u2.psz amd64 systemd utility library
ii systemd 215-17+deb8u2.psz amd64 system and service manager
ii systemd-sysv 215-17+deb8u2.psz amd64 system and service manager - SysV links
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
root at p639:~# echo $$ > /sys/fs/cgroup/cpu/mytest/tasks
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
7198
root at p639:~# systemctl daemon-reload
root at p639:~# systemctl start anacron
root at p639:~# grep . /sys/fs/cgroup/cpu/mytest/tasks
7198
root at p639:~#
I wonder what is different between your jessie machine and mine.
Cheers, Paul
Paul Szabo psz at maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
More information about the Pkg-systemd-maintainers
mailing list