chiark / gitweb /
login: track login class (i.e. one of "user", "greeter", "lock-screen") for each...
[elogind.git] / src / login / loginctl.c
index 1be47c8..30e97e3 100644 (file)
@@ -349,6 +349,7 @@ typedef struct SessionStatusInfo {
         const char *service;
         pid_t leader;
         const char *type;
         const char *service;
         pid_t leader;
         const char *type;
+        const char *class;
         bool active;
 } SessionStatusInfo;
 
         bool active;
 } SessionStatusInfo;
 
@@ -431,10 +432,19 @@ static void print_session_status_info(SessionStatusInfo *i) {
                 if (i->type)
                         printf("; type %s", i->type);
 
                 if (i->type)
                         printf("; type %s", i->type);
 
+                if (i->class)
+                        printf("; class %s", i->class);
+
                 printf("\n");
                 printf("\n");
-        } else if (i->type)
+        } else if (i->type) {
                 printf("\t    Type: %s\n", i->type);
 
                 printf("\t    Type: %s\n", i->type);
 
+                if (i->class)
+                        printf("; class %s", i->class);
+        } else if (i->class)
+                printf("\t   Class: %s\n", i->class);
+
+
         printf("\t  Active: %s\n", yes_no(i->active));
 
         if (i->control_group) {
         printf("\t  Active: %s\n", yes_no(i->active));
 
         if (i->control_group) {
@@ -449,7 +459,7 @@ static void print_session_status_info(SessionStatusInfo *i) {
                         else
                                 c = 0;
 
                         else
                                 c = 0;
 
-                        show_cgroup_by_path(i->control_group, "\t\t  ", c);
+                        show_cgroup_by_path(i->control_group, "\t\t  ", c, false);
                 }
         }
 }
                 }
         }
 }
@@ -501,7 +511,7 @@ static void print_user_status_info(UserStatusInfo *i) {
                         else
                                 c = 0;
 
                         else
                                 c = 0;
 
-                        show_cgroup_by_path(i->control_group, "\t\t  ", c);
+                        show_cgroup_by_path(i->control_group, "\t\t  ", c, false);
                 }
         }
 }
                 }
         }
 }
@@ -571,6 +581,8 @@ static int status_property_session(const char *name, DBusMessageIter *iter, Sess
                                 i->service = s;
                         else if (streq(name, "Type"))
                                 i->type = s;
                                 i->service = s;
                         else if (streq(name, "Type"))
                                 i->type = s;
+                        else if (streq(name, "Class"))
+                                i->class = s;
                 }
                 break;
         }
                 }
                 break;
         }