chiark / gitweb /
man: bring systemctl man page and --help text into the same order
[elogind.git] / src / systemctl / systemctl.c
index b44c6d78ba581757d32a22249407f3267c031384..74528dd5b6cbbefae35d610b0af78c745ab76085 100644 (file)
@@ -176,7 +176,6 @@ static void ask_password_agent_open_if_enabled(void) {
         ask_password_agent_open();
 }
 
-#ifdef HAVE_LOGIND
 static void polkit_agent_open_if_enabled(void) {
 
         /* Open the polkit agent as a child process if necessary */
@@ -192,7 +191,6 @@ static void polkit_agent_open_if_enabled(void) {
 
         polkit_agent_open();
 }
-#endif
 
 static OutputFlags get_output_flags(void) {
         return
@@ -2706,6 +2704,7 @@ static int start_unit(sd_bus *bus, char **args) {
         assert(bus);
 
         ask_password_agent_open_if_enabled();
+        polkit_agent_open_if_enabled();
 
         if (arg_action == ACTION_SYSTEMCTL) {
                 enum action action;
@@ -3029,6 +3028,8 @@ static int kill_unit(sd_bus *bus, char **args) {
         assert(bus);
         assert(args);
 
+        polkit_agent_open_if_enabled();
+
         if (!arg_kill_who)
                 arg_kill_who = "all";
 
@@ -4601,6 +4602,8 @@ static int set_property(sd_bus *bus, char **args) {
         char **i;
         int r;
 
+        polkit_agent_open_if_enabled();
+
         r = sd_bus_message_new_method_call(
                         bus,
                         &m,
@@ -4661,6 +4664,8 @@ static int snapshot(sd_bus *bus, char **args) {
         const char *path;
         int r;
 
+        polkit_agent_open_if_enabled();
+
         if (strv_length(args) > 1)
                 n = unit_name_mangle_with_suffix(args[1], MANGLE_NOGLOB, ".snapshot");
         else
@@ -4723,6 +4728,8 @@ static int delete_snapshot(sd_bus *bus, char **args) {
 
         assert(args);
 
+        polkit_agent_open_if_enabled();
+
         r = expand_names(bus, args + 1, ".snapshot", &names);
         if (r < 0)
                 log_error_errno(r, "Failed to expand names: %m");
@@ -4766,6 +4773,8 @@ static int daemon_reload(sd_bus *bus, char **args) {
         const char *method;
         int r;
 
+        polkit_agent_open_if_enabled();
+
         if (arg_action == ACTION_RELOAD)
                 method = "Reload";
         else if (arg_action == ACTION_REEXEC)
@@ -4824,6 +4833,8 @@ static int reset_failed(sd_bus *bus, char **args) {
         if (strv_length(args) <= 1)
                 return daemon_reload(bus, args);
 
+        polkit_agent_open_if_enabled();
+
         r = expand_names(bus, args + 1, NULL, &names);
         if (r < 0)
                 log_error_errno(r, "Failed to expand names: %m");
@@ -5285,6 +5296,8 @@ static int enable_unit(sd_bus *bus, char **args) {
                 bool send_force = true, send_preset_mode = false;
                 const char *method;
 
+                polkit_agent_open_if_enabled();
+
                 if (streq(verb, "enable")) {
                         method = "EnableUnitFiles";
                         expect_carries_install_info = true;
@@ -5430,6 +5443,8 @@ static int add_dependency(sd_bus *bus, char **args) {
                 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL;
                 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 
+                polkit_agent_open_if_enabled();
+
                 r = sd_bus_message_new_method_call(
                                 bus,
                                 &m,
@@ -5493,6 +5508,8 @@ static int preset_all(sd_bus *bus, char **args) {
                 _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
                 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 
+                polkit_agent_open_if_enabled();
+
                 r = sd_bus_message_new_method_call(
                                 bus,
                                 &m,
@@ -6058,7 +6075,7 @@ static void systemctl_help(void) {
                "                                  based on preset configuration\n"
                "  preset-all                      Enable/disable all unit files based on\n"
                "                                  preset configuration\n"
-               "  is-enabled NAME...              Check whether unit files are enabled\n\n"
+               "  is-enabled NAME...              Check whether unit files are enabled\n"
                "  mask NAME...                    Mask one or more units\n"
                "  unmask NAME...                  Unmask one or more units\n"
                "  link PATH...                    Link one or more units files into\n"
@@ -6067,10 +6084,9 @@ static void systemctl_help(void) {
                "                                  on specified one or more units\n"
                "  add-requires TARGET NAME...     Add 'Requires' dependency for the target\n"
                "                                  on specified one or more units\n"
-               "  get-default                     Get the name of the default target\n"
-               "  set-default NAME                Set the default target\n"
                "  edit NAME...                    Edit one or more unit files\n"
-               "\n"
+               "  get-default                     Get the name of the default target\n"
+               "  set-default NAME                Set the default target\n\n"
                "Machine Commands:\n"
                "  list-machines [PATTERN...]      List local containers and host\n\n"
                "Job Commands:\n"