chiark / gitweb /
systemctl: print the user session journal for user session units.
authorMirco Tischler <mt-ml@gmx.de>
Thu, 17 Jan 2013 17:55:08 +0000 (18:55 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jan 2013 16:14:00 +0000 (11:14 -0500)
src/systemctl/systemctl.c

index f3d661d..fb4ae24 100644 (file)
@@ -2734,13 +2734,23 @@ static void print_status_info(UnitStatusInfo *i) {
 
         if (i->id && arg_transport != TRANSPORT_SSH) {
                 printf("\n");
-                show_journal_by_unit(stdout,
-                                     i->id,
-                                     arg_output,
-                                     0,
-                                     i->inactive_exit_timestamp_monotonic,
-                                     arg_lines,
-                                     flags);
+                if(arg_scope == UNIT_FILE_SYSTEM)
+                        show_journal_by_unit(stdout,
+                                             i->id,
+                                             arg_output,
+                                             0,
+                                             i->inactive_exit_timestamp_monotonic,
+                                             arg_lines,
+                                             flags);
+                else
+                        show_journal_by_user_unit(stdout,
+                                                  i->id,
+                                                  arg_output,
+                                                  0,
+                                                  i->inactive_exit_timestamp_monotonic,
+                                                  arg_lines,
+                                                  getuid(),
+                                                  flags);
         }
 
         if (i->need_daemon_reload)