chiark / gitweb /
Prep v233: Add missing updates from upstream in src/login
authorSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:37:38 +0000 (17:37 +0200)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 16:12:27 +0000 (18:12 +0200)
src/login/eloginctl.c
src/login/elogind-dbus.c
src/login/elogind.c
src/login/logind-dbus.c
src/login/logind-seat.c
src/login/logind-session.c

index dd0a89d..a1863a9 100644 (file)
@@ -209,49 +209,49 @@ static void elogind_log_special(enum elogind_action a) {
         case ACTION_HALT:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Halt action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                           "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                            NULL);
                 break;
         case ACTION_POWEROFF:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Poweroff action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                           "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                            NULL);
                 break;
         case ACTION_REBOOT:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Reboot action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                           "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                            NULL);
                 break;
         case ACTION_KEXEC:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("KExec action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                           "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                            NULL);
                 break;
         case ACTION_SUSPEND:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Suspend action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START),
+                           "MESSAGE_ID=" SD_MESSAGE_SLEEP_START_STR,
                            NULL);
                 break;
         case ACTION_HIBERNATE:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Hibernate action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START),
+                           "MESSAGE_ID=" SD_MESSAGE_SLEEP_START_STR,
                            NULL);
                 break;
         case ACTION_HYBRID_SLEEP:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Hybrid-Sleep action called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_START),
+                           "MESSAGE_ID=" SD_MESSAGE_SLEEP_START_STR,
                            NULL);
                 break;
         case ACTION_CANCEL_SHUTDOWN:
                 log_struct(LOG_INFO,
                            LOG_MESSAGE("Cancel Shutdown called."),
-                           LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                           "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                            NULL);
                 break;
         default:
index a35ca17..23ea9bd 100644 (file)
@@ -90,7 +90,7 @@ static int bus_manager_log_shutdown(
                 p = strjoina(p, " (", m->wall_message, ").");
 
         return log_struct(LOG_NOTICE,
-                          LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                          "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                           p,
                           q,
                           NULL);
index 5da9ae6..57d6fe4 100644 (file)
@@ -145,7 +145,10 @@ int elogind_setup_cgroups_agent(Manager *m) {
         if (!MANAGER_IS_SYSTEM(m))
                 return 0;
 
-        if (cg_unified(SYSTEMD_CGROUP_CONTROLLER) > 0) /* We don't need this anymore on the unified hierarchy */
+        r = cg_unified_controller(SYSTEMD_CGROUP_CONTROLLER);
+        if (r < 0)
+                return log_error_errno(r, "Failed to determine whether unified cgroups hierarchy is used: %m");
+        if (r > 0) /* We don't need this anymore on the unified hierarchy */
                 return 0;
 
         if (m->cgroups_agent_fd < 0) {
index 598b931..971b447 100644 (file)
@@ -1446,7 +1446,7 @@ static int bus_manager_log_shutdown(
                 p = strjoina(p, " (", m->wall_message, ").");
 
         return log_struct(LOG_NOTICE,
-                          LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+                          "MESSAGE_ID=" SD_MESSAGE_SHUTDOWN_STR,
                           p,
                           q,
                           NULL);
index 84a46bf..de27e71 100644 (file)
@@ -419,7 +419,7 @@ int seat_start(Seat *s) {
                 return 0;
 
         log_struct(LOG_INFO,
-                   LOG_MESSAGE_ID(SD_MESSAGE_SEAT_START),
+                   "MESSAGE_ID=" SD_MESSAGE_SEAT_START_STR,
                    "SEAT_ID=%s", s->id,
                    LOG_MESSAGE("New seat %s.", s->id),
                    NULL);
@@ -449,7 +449,7 @@ int seat_stop(Seat *s, bool force) {
 
         if (s->started)
                 log_struct(LOG_INFO,
-                           LOG_MESSAGE_ID(SD_MESSAGE_SEAT_STOP),
+                           "MESSAGE_ID=" SD_MESSAGE_SEAT_STOP_STR,
                            "SEAT_ID=%s", s->id,
                            LOG_MESSAGE("Removed seat %s.", s->id),
                            NULL);
index b6456ce..bd2aac9 100644 (file)
@@ -592,7 +592,7 @@ int session_start(Session *s) {
                 return r;
 
         log_struct(s->class == SESSION_BACKGROUND ? LOG_DEBUG : LOG_INFO,
-                   LOG_MESSAGE_ID(SD_MESSAGE_SESSION_START),
+                   "MESSAGE_ID=" SD_MESSAGE_SESSION_START_STR,
                    "SESSION_ID=%s", s->id,
                    "USER_ID=%s", s->user->name,
                    "LEADER="PID_FMT, s->leader,
@@ -718,7 +718,7 @@ int session_finalize(Session *s) {
 
         if (s->started)
                 log_struct(s->class == SESSION_BACKGROUND ? LOG_DEBUG : LOG_INFO,
-                           LOG_MESSAGE_ID(SD_MESSAGE_SESSION_STOP),
+                           "MESSAGE_ID=" SD_MESSAGE_SESSION_STOP_STR,
                            "SESSION_ID=%s", s->id,
                            "USER_ID=%s", s->user->name,
                            "LEADER="PID_FMT, s->leader,