/* SPDX-License-Identifier: LGPL-2.1+ */
/***
- This file is part of systemd.
-
Copyright 2011 Lennart Poettering
***/
if (s->desktop) {
_cleanup_free_ char *escaped;
-
escaped = cescape(s->desktop);
if (!escaped) {
r = -ENOMEM;
assert(s);
- r = parse_env_file(s->state_file, NEWLINE,
+ r = parse_env_file(NULL, s->state_file, NEWLINE,
"REMOTE", &remote,
"SCOPE", &s->scope,
#if 0 /// elogind does not support systemd scope_jobs
}
#if 0 /// UNNEEDED by elogind
-static int session_start_scope(Session *s) {
+static int session_start_scope(Session *s, sd_bus_message *properties) {
int r;
assert(s);
description,
"systemd-logind.service",
"systemd-user-sessions.service",
- (uint64_t) -1, /* disable TasksMax= for the scope, rely on the slice setting for it */
+ properties,
&error,
&job);
if (r < 0) {
}
#endif // 0
-int session_start(Session *s) {
+int session_start(Session *s, sd_bus_message *properties) {
int r;
assert(s);
/* Create cgroup */
#if 0 /// elogind does its own session management
- r = session_start_scope(s);
+ r = session_start_scope(s, properties);
#else
r = session_start_cgroup(s);
#endif // 0
"SESSION_ID=%s", s->id,
"USER_ID=%s", s->user->name,
"LEADER="PID_FMT, s->leader,
- LOG_MESSAGE("New session %s of user %s.", s->id, s->user->name),
- NULL);
+ LOG_MESSAGE("New session %s of user %s.", s->id, s->user->name));
if (!dual_timestamp_is_set(&s->timestamp))
dual_timestamp_get(&s->timestamp);
free(s->scope_job);
s->scope_job = job;
- } else
+ } else {
s->scope_job = mfree(s->scope_job);
+ /* With no killing, this session is allowed to persist in "closing" state indefinitely.
+ * Therefore session stop and session removal may be two distinct events.
+ * Session stop is quite significant on its own, let's log it. */
+ log_struct(s->class == SESSION_BACKGROUND ? LOG_DEBUG : LOG_INFO,
+ "SESSION_ID=%s", s->id,
+ "USER_ID=%s", s->user->name,
+ "LEADER="PID_FMT, s->leader,
+ LOG_MESSAGE("Session %s logged out. Waiting for processes to exit.", s->id));
+ }
+
return 0;
}
#else
"LEADER="PID_FMT, s->leader,
LOG_MESSAGE("Removed session %s.", s->id),
NULL);
+ LOG_MESSAGE("Removed session %s.", s->id));
s->timer_event_source = sd_event_source_unref(s->timer_event_source);