diff options
author | Andy Wingo <wingo@pobox.com> | 2016-03-06 16:02:31 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:16:21 +0100 |
commit | ebbac6d948b9d323b3d57bfd7c3513776e591dc1 (patch) | |
tree | 87e01cc886beee3a793ad134ec7886b0f3faab71 /src/login/logind-user.c | |
parent | 72e62add23de109474c5d85cb9bf0100cb7e8108 (diff) |
Classify processes from sessions into cgroups
Create a private cgroup tree associated with no controllers, and use it
to map PIDs to sessions. Since we use our own path structure, remove
internal cgroup-related helpers that interpret the cgroup path structure
to pull out users, slices, and scopes.
Diffstat (limited to 'src/login/logind-user.c')
-rw-r--r-- | src/login/logind-user.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 84f549479..2ea2067b2 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -579,10 +579,18 @@ UserState user_get_state(User *u) { } int user_kill(User *u, int signo) { + Session *s; + int res = 0; + assert(u); - /* FIXME: No way to kill a user without systemd. */ - return -ESRCH; + LIST_FOREACH(sessions_by_user, s, u->sessions) { + int r = session_kill(s, KILL_ALL, signo); + if (res == 0 && r < 0) + res = r; + } + + return res; } static bool elect_display_filter(Session *s) { |