]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: rename "reload-or-try-restart" verb to "try-reload-or-restart" 2464/head
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Jan 2016 17:57:04 +0000 (18:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Jan 2016 17:57:04 +0000 (18:57 +0100)
But also keep the old name as (undocumented) compatibility around.

The reload-or-try-restart was documented to be a NOP if the unit is not running, since the previous commits this is
also implemented. The old name suggests that the "try" logic only applies to restarting. Fix this, by moving the "try-"
to the front, to indicate that the whole option is a NOP if the service isn't running.

man/systemctl.xml
shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in
src/systemctl/systemctl.c

index 6e5369f061291826b350c297a374eed627dbaf88..cce7861139334c683cfd9138f8927bd071996280 100644 (file)
@@ -748,7 +748,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
           </listitem>
         </varlistentry>
         <varlistentry>
-          <term><command>reload-or-try-restart <replaceable>PATTERN</replaceable>...</command></term>
+          <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>...</command></term>
 
           <listitem>
             <para>Reload one or more units if they support it. If not,
index 6ffab33e4592234d492bebf0aad11cabf083ef9c..ef7dc6285ab4f8629edd822ce4cdb40b4101a1ec 100644 (file)
@@ -170,7 +170,7 @@ _systemctl () {
           [STARTABLE_UNITS]='start'
           [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart'
          [ISOLATABLE_UNITS]='isolate'
-         [RELOADABLE_UNITS]='reload condreload reload-or-try-restart force-reload'
+         [RELOADABLE_UNITS]='reload condreload try-reload-or-restart force-reload'
         [RESTARTABLE_UNITS]='restart reload-or-restart'
          [TARGET_AND_UNITS]='add-wants add-requires'
              [MASKED_UNITS]='unmask'
index 58c88c9d982dd28c3c31c6f13b86d181b7edba94..667243eb53bbf15a61c30394973130d211284a40 100644 (file)
@@ -17,7 +17,7 @@
     "force-reload:Reload one or more units if possible, otherwise restart if active"
     "hibernate:Hibernate the system"
     "hybrid-sleep:Hibernate and suspend the system"
-    "reload-or-try-restart:Reload one or more units if possible, otherwise restart if active"
+    "try-reload-or-restart:Reload one or more units if possible, otherwise restart if active"
     "isolate:Start one unit and stop all others"
     "kill:Send signal to processes of a unit"
     "is-active:Check whether units are active"
@@ -69,7 +69,7 @@
     # Deal with any aliases
     case $cmd in
       condrestart) cmd="try-restart";;
-      force-reload) cmd="reload-or-try-restart";;
+      force-reload) cmd="try-reload-or-restart";;
     esac
 
     if (( $#cmd )); then
@@ -230,7 +230,7 @@ done
 }
 
 # Completion functions for RELOADABLE_UNITS
-for fun in reload reload-or-try-restart force-reload ; do
+for fun in reload try-reload-or-restart force-reload ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
   {
     local _sys_active_units; _systemctl_active_units
index 12209dc99b89d99c31a8bbb47812877affcee6ad..f5703af241d21bbb31ac4934c2841bba3cd8d474 100644 (file)
@@ -2538,6 +2538,7 @@ static const struct {
         { "try-restart",           "TryRestartUnit" },
         { "condrestart",           "TryRestartUnit" },
         { "reload-or-restart",     "ReloadOrRestartUnit" },
+        { "try-reload-or-restart", "ReloadOrTryRestartUnit" },
         { "reload-or-try-restart", "ReloadOrTryRestartUnit" },
         { "condreload",            "ReloadOrTryRestartUnit" },
         { "force-reload",          "ReloadOrTryRestartUnit" }
@@ -6234,8 +6235,8 @@ static void systemctl_help(void) {
                "  try-restart NAME...             Restart one or more units if active\n"
                "  reload-or-restart NAME...       Reload one or more units if possible,\n"
                "                                  otherwise start or restart\n"
-               "  reload-or-try-restart NAME...   Reload one or more units if possible,\n"
-               "                                  otherwise restart if active\n"
+               "  try-reload-or-restart NAME...   If active, reload one or more units,\n"
+               "                                  if supported, otherwise restart\n"
                "  isolate NAME                    Start one unit and stop all others\n"
                "  kill NAME...                    Send signal to processes of a unit\n"
                "  is-active PATTERN...            Check whether units are active\n"