chiark / gitweb /
systemctl: properly detect whether taling to systemd via D-Bus worked before falling...
[elogind.git] / src / systemctl.c
index cf075ed7a3d6ab186ea23f2a9b8e7fc0c05f996a..2e7a6a8c5c023376d20bc9d4dd9f0941fcbead03 100644 (file)
@@ -1171,7 +1171,10 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
         }
 
         if (!arg_no_block)
-                r = wait_for_jobs(bus, s);
+                if ((r = wait_for_jobs(bus, s)) < 0)
+                        goto finish;
+
+        r = 1;
 
 finish:
         if (s)
@@ -3709,7 +3712,7 @@ static int systemctl_help(void) {
                "                                  otherwise restart if active\n"
                "  isolate [NAME]                  Start one unit and stop all others\n"
                "  is-active [NAME...]             Check whether units are active\n"
-               "  status [NAME...]                Show runtime status of one or more units\n"
+               "  status [NAME...|PID...]         Show runtime status of one or more units\n"
                "  show [NAME...|JOB...]           Show properties of one or more\n"
                "                                  units/jobs or the manager\n"
                "  reset-maintenance [NAME...]     Reset maintenance state for all, one,\n"
@@ -4599,7 +4602,7 @@ static int start_with_fallback(DBusConnection *bus) {
 
         /* Nothing else worked, so let's try
          * /dev/initctl */
-        if (talk_initctl() != 0)
+        if (talk_initctl() > 0)
                 goto done;
 
         log_error("Failed to talk to init daemon.");