free(s->scope);
}
+/// elogind does not support systemd scope_jobs
+#if 0
free(s->scope_job);
+#endif // 0
sd_bus_message_unref(s->create_message);
if (s->scope)
fprintf(f, "SCOPE=%s\n", s->scope);
+/// elogind does not support systemd scope_jobs
+#if 0
if (s->scope_job)
fprintf(f, "SCOPE_JOB=%s\n", s->scope_job);
+#endif // 0
if (s->fifo_path)
fprintf(f, "FIFO=%s\n", s->fifo_path);
r = parse_env_file(s->state_file, NEWLINE,
"REMOTE", &remote,
"SCOPE", &s->scope,
+/// elogind does not support systemd scope_jobs
+#if 0
"SCOPE_JOB", &s->scope_job,
+#endif // 0
"FIFO", &s->fifo_path,
"SEAT", &seat,
"TTY", &s->tty,
}
static int session_start_scope(Session *s) {
- int r;
+ int r = 0;
assert(s);
assert(s->user);
if (!s->scope) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_free_ char *description = NULL;
- char *scope, *job = NULL;
+ char *scope = NULL; //, *job = NULL;
description = strjoin("Session ", s->id, " of user ", s->user->name, NULL);
if (!description)
if (!scope)
return log_oom();
+/// elogind : Do not try to use dbus to call systemd
+#if 0
r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "logind.service", "systemd-user-sessions.service", &error, &job);
+#endif // 0
if (r < 0) {
log_error("Failed to start session scope %s: %s %s",
scope, bus_error_message(&error, r), error.name);
return r;
} else {
s->scope = scope;
-
+/// elogind does not support scope jobs
+#if 0
free(s->scope_job);
s->scope_job = job;
+#endif // 0
}
}
return 0;
}
+/// UNNEEDED by elogind
+#if 0
static int session_stop_scope(Session *s, bool force) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
char *job = NULL;
return 0;
}
+#endif // 0
int session_stop(Session *s, bool force) {
- int r;
+ int r = 0;
assert(s);
session_remove_fifo(s);
/* Kill cgroup */
+/// @todo : Currently elogind does not start scopes. It remains to be seen
+/// whether this is really not needed, but then, elogind is not a
+/// systemd cgroups manager.
+#if 0
r = session_stop_scope(s, force);
+#endif // 0
s->stopping = true;
return true;
}
+/// elogind supports neither scopes nor jobs
+#if 0
if (s->scope_job && manager_job_is_active(s->manager, s->scope_job))
return true;
if (s->scope && manager_unit_is_active(s->manager, s->scope))
return true;
+#endif // 0
return false;
}
if (s->stopping || s->timer_event_source)
return SESSION_CLOSING;
+/// elogind does not support systemd scope_jobs
+#if 0
if (s->scope_job || s->fifo_fd < 0)
+#else
+ if (s->fifo_fd < 0)
+#endif // 0
return SESSION_OPENING;
if (session_is_active(s))
int session_kill(Session *s, KillWho who, int signo) {
assert(s);
+/// FIXME: Without direct cgroup support, elogind can not kill sessions
+#if 0
if (!s->scope)
return -ESRCH;
return manager_kill_unit(s->manager, s->scope, who, signo, NULL);
+#else
+ return -ESRCH;
+#endif // 0
}
static int session_open_vt(Session *s) {