]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: make sure 'status' shows whether units are transient
authorLennart Poettering <lennart@poettering.net>
Wed, 18 Nov 2015 11:20:04 +0000 (12:20 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 18 Nov 2015 16:04:05 +0000 (17:04 +0100)
src/systemctl/systemctl.c

index 51b82d57dbf7b44f2e9ec8725deeba82c9496be7..96f4c541544afb351708b06a9eaca12c0e94986c 100644 (file)
@@ -3360,6 +3360,7 @@ typedef struct UnitStatusInfo {
         usec_t inactive_enter_timestamp;
 
         bool need_daemon_reload;
+        bool transient;
 
         /* Service */
         pid_t main_pid;
@@ -3459,7 +3460,7 @@ static void print_status_info(
 
         path = i->source_path ? i->source_path : i->fragment_path;
 
-        if (i->load_error)
+        if (i->load_error != 0)
                 printf("   Loaded: %s%s%s (Reason: %s)\n",
                        on, strna(i->load_state), off, i->load_error);
         else if (path && !isempty(i->unit_file_state) && !isempty(i->unit_file_preset))
@@ -3475,6 +3476,9 @@ static void print_status_info(
                 printf("   Loaded: %s%s%s\n",
                        on, strna(i->load_state), off);
 
+        if (i->transient)
+                printf("Transient: yes\n");
+
         if (!strv_isempty(i->dropin_paths)) {
                 _cleanup_free_ char *dir = NULL;
                 bool last = false;
@@ -3839,6 +3843,8 @@ static int status_property(const char *name, sd_bus_message *m, UnitStatusInfo *
                         i->condition_result = b;
                 else if (streq(name, "AssertResult"))
                         i->assert_result = b;
+                else if (streq(name, "Transient"))
+                        i->transient = b;
 
                 break;
         }