summaryrefslogtreecommitdiff
path: root/src/login/logind-user.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-03-06 16:02:31 +0100
committerAndy Wingo <wingo@pobox.com>2016-03-06 16:02:31 +0100
commit162255186046fa7a5e82859b7dba5a7909ce6fc4 (patch)
tree8b81f2e7afac4df45ebca6e662d4d2b1d8635e5a /src/login/logind-user.c
parent6f5035f2db6ab7b4beae46c44b95e6a8b6d956b5 (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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 539c316ad..0aac3bcf5 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -562,10 +562,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;
}
void user_elect_display(User *u) {