[systemd-devel] [bug] empty cgroups remain after session exit

Dave Reisner d at falconindy.com
Mon Dec 26 15:15:29 PST 2011


Hi,

I'm noticing that even after this was "fixed" [1] that I'm still getting
a lot of empty cgroups piling up, e.g.:

├ user
│ └ root
│   ├ 4
│   │ ├ 618 /bin/login --
│   │ ├ 619 -bash
│   │ └ 642 systemd-cgls --no-pager
│   ├ 3
│   ├ 2
│   └ 1

Reproducible with login and sshd, both having pam_systemd.so added to
the appropriate PAM file without any options. Debug output shows that
logind removes the session:

Dec 26 18:04:12 kweemoo systemd-logind[342]: New session 3 of user root.
Dec 26 18:04:12 kweemoo systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
Dec 26 18:04:15 kweemoo systemd-logind[342]: Removed session 3.
Dec 26 18:04:15 kweemoo systemd[1]: Received SIGCHLD from PID 587 (login).
Dec 26 18:04:15 kweemoo systemd[1]: Got SIGCHLD for process 587 (login)
Dec 26 18:04:15 kweemoo systemd[1]: Child 587 died (code=exited, status=0/SUCCESS)
...

But the associated cgroup is never pruned, despite the cgroup having no
associated tasks.

It's interesting to note that adding kill-session-processes=1 as an
option to pam_systemd will cause to the empty cgroup to be pruned as
expected. 

I can currently reproduce this on a build from the latest git, on kernel
3.1.6.

Regards,
Dave

[1] http://cgit.freedesktop.org/systemd/commit/?id=353fa6a21


More information about the systemd-devel mailing list