summaryrefslogtreecommitdiff
path: root/src/login/logind-session.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-02-08 20:29:56 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-02-11 19:14:47 -0500
commit9bb69af4f2823fdd30902f5ffd959e9b041feb53 (patch)
tree071ab8a885f25ad123958e4aa3eb4fe708a8f587 /src/login/logind-session.c
parent4daf54a851e4fb7ed1a13c3117bba12528fd2c7f (diff)
logind: always kill session when termination is requested
KillUserProcesses=yes/no should be ignored when termination is explicitly requested.
Diffstat (limited to 'src/login/logind-session.c')
-rw-r--r--src/login/logind-session.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index f661cc8b8d..d4742e1134 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -565,7 +565,7 @@ int session_start(Session *s) {
return 0;
}
-static int session_stop_scope(Session *s) {
+static int session_stop_scope(Session *s, bool force) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
char *job;
int r;
@@ -575,7 +575,7 @@ static int session_stop_scope(Session *s) {
if (!s->scope)
return 0;
- if (manager_shall_kill(s->manager, s->user->name)) {
+ if (force || manager_shall_kill(s->manager, s->user->name)) {
r = manager_stop_unit(s->manager, s->scope, &error, &job);
if (r < 0) {
log_error("Failed to stop session scope: %s", bus_error_message(&error, r));
@@ -595,7 +595,7 @@ static int session_stop_scope(Session *s) {
return 0;
}
-int session_stop(Session *s) {
+int session_stop(Session *s, bool force) {
int r;
assert(s);
@@ -609,7 +609,7 @@ int session_stop(Session *s) {
session_remove_fifo(s);
/* Kill cgroup */
- r = session_stop_scope(s);
+ r = session_stop_scope(s, force);
s->stopping = true;
@@ -672,7 +672,7 @@ static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *us
assert(es);
assert(s);
- session_stop(s);
+ session_stop(s, false);
return 0;
}
@@ -812,7 +812,7 @@ static int session_dispatch_fifo(sd_event_source *es, int fd, uint32_t revents,
/* EOF on the FIFO means the session died abnormally. */
session_remove_fifo(s);
- session_stop(s);
+ session_stop(s, false);
return 1;
}