summaryrefslogtreecommitdiff
path: root/src/logind-user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logind-user.c')
-rw-r--r--src/logind-user.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/logind-user.c b/src/logind-user.c
index 70d6a9a524..cb3e44197f 100644
--- a/src/logind-user.c
+++ b/src/logind-user.c
@@ -260,6 +260,9 @@ int user_start(User *u) {
assert(u);
+ if (u->started)
+ return 0;
+
/* Make XDG_RUNTIME_DIR */
r = user_mkdir_runtime_path(u);
if (r < 0)
@@ -280,6 +283,8 @@ int user_start(User *u) {
dual_timestamp_get(&u->timestamp);
+ u->started = true;
+
user_send_signal(u, true);
return 0;
@@ -361,6 +366,9 @@ int user_stop(User *u) {
int r = 0, k;
assert(u);
+ if (!u->started)
+ return 0;
+
LIST_FOREACH(sessions_by_user, s, u->sessions) {
k = session_stop(s);
if (k < 0)
@@ -387,6 +395,8 @@ int user_stop(User *u) {
unlink(u->state_file);
user_add_to_gc_queue(u);
+ u->started = false;
+
return r;
}