#include <linux/vt.h>
#include <string.h>
+#include "systemd/sd-id128.h"
+#include "systemd/sd-messages.h"
#include "logind-seat.h"
#include "logind-acl.h"
#include "util.h"
if (old_active) {
session_save(old_active);
- user_save(old_active->user);
+ if (!session || session->user != old_active->user)
+ user_save(old_active->user);
}
return 0;
if (s->started)
return 0;
- log_info("New seat %s.", s->id);
+ log_struct(LOG_INFO,
+ MESSAGE_ID(SD_MESSAGE_SEAT_START),
+ "SEAT_ID=%s", s->id,
+ "MESSAGE=New seat %s.", s->id,
+ NULL);
/* Initialize VT magic stuff */
seat_preallocate_vts(s);
assert(s);
if (s->started)
- log_info("Removed seat %s.", s->id);
+ log_struct(LOG_INFO,
+ MESSAGE_ID(SD_MESSAGE_SEAT_STOP),
+ "SEAT_ID=%s", s->id,
+ "MESSAGE=Removed seat %s.", s->id,
+ NULL);
seat_stop_sessions(s);
if (!ih) {
if (!idle_hint) {
- if (k.monotonic < ts.monotonic)
+ if (k.monotonic > ts.monotonic)
ts = k;
} else {
idle_hint = false;