chiark / gitweb /
main: minor optimization
[elogind.git] / src / systemctl.c
index c08e78c26d55ea6049289c9e6b81bc91f5d6f44e..b733b47c84420eb90d0b1a12ff42a260723f040d 100644 (file)
@@ -1421,6 +1421,7 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
                         streq(args[0], "condrestart")           ? "TryRestartUnit" :
                         streq(args[0], "reload-or-restart")     ? "ReloadOrRestartUnit" :
                         streq(args[0], "reload-or-try-restart") ||
+                        streq(args[0], "condreload") ||
                         streq(args[0], "force-reload")          ? "ReloadOrTryRestartUnit" :
                                                                   "StartUnit";
 
@@ -2369,6 +2370,25 @@ static int print_property(const char *name, DBusMessageIter *iter) {
 
                         return 0;
 
+                } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRUCT && streq(name, "EnvironmentFiles")) {
+                        DBusMessageIter sub, sub2;
+
+                        dbus_message_iter_recurse(iter, &sub);
+                        while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRUCT) {
+                                const char *path;
+                                dbus_bool_t ignore;
+
+                                dbus_message_iter_recurse(&sub, &sub2);
+
+                                if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &path, true) >= 0 &&
+                                    bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_BOOLEAN, &ignore, false) >= 0)
+                                        printf("EnvironmentFile=%s (ignore=%s)\n", path, yes_no(ignore));
+
+                                dbus_message_iter_next(&sub);
+                        }
+
+                        return 0;
+
                 } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRUCT && streq(name, "Paths")) {
                         DBusMessageIter sub, sub2;
 
@@ -5166,6 +5186,7 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
                 { "reload-or-restart",     MORE,  2, start_unit        },
                 { "reload-or-try-restart", MORE,  2, start_unit        },
                 { "force-reload",          MORE,  2, start_unit        }, /* For compatibility with SysV */
+                { "condreload",            MORE,  2, start_unit        }, /* For compatibility with ALTLinux */
                 { "condrestart",           MORE,  2, start_unit        }, /* For compatibility with RH */
                 { "isolate",               EQUAL, 2, start_unit        },
                 { "kill",                  MORE,  2, kill_unit         },
@@ -5530,6 +5551,7 @@ static void pager_close(void) {
 
         /* Inform pager that we are done */
         fclose(stdout);
+        kill(pager_pid, SIGCONT);
         wait_for_terminate(pager_pid, &dummy);
         pager_pid = 0;
 }
@@ -5542,6 +5564,7 @@ static void agent_close(void) {
 
         /* Inform agent that we are done */
         kill(agent_pid, SIGTERM);
+        kill(agent_pid, SIGCONT);
         wait_for_terminate(agent_pid, &dummy);
         agent_pid = 0;
 }