b1b7198
From ea7a3a783f8c9f49f5aedae9574fd70d9c9074ec Mon Sep 17 00:00:00 2001
b1b7198
From: Lennart Poettering <lennart@poettering.net>
b1b7198
Date: Tue, 26 Jan 2016 19:50:04 +0100
b1b7198
Subject: [PATCH 3/6] man: document that unit file globbing only operates on
b1b7198
 primary unit names
b1b7198
b1b7198
See: #2397
b1b7198
(cherry picked from commit 1f00ededc7451933e23a95597804897b37fa88d6)
b1b7198
b1b7198
Related: #1288851
b1b7198
---
b1b7198
 man/systemctl.xml | 27 ++++++++++++---------------
b1b7198
 1 file changed, 12 insertions(+), 15 deletions(-)
b1b7198
b1b7198
diff --git a/man/systemctl.xml b/man/systemctl.xml
b1b7198
index 66a0900..50e8ce0 100644
b1b7198
--- a/man/systemctl.xml
b1b7198
+++ b/man/systemctl.xml
b1b7198
@@ -658,14 +658,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
b1b7198
             <para>Start (activate) one or more units specified on the
b1b7198
             command line.</para>
b1b7198
 
b1b7198
-            <para>Note that glob patterns operate on a list of currently
b1b7198
-            loaded units. Units which are not active and are not in a
b1b7198
-            failed state usually are not loaded, and would not be
b1b7198
-            matched by any pattern. In addition, in case of
b1b7198
-            instantiated units, systemd is often unaware of the
b1b7198
-            instance name until the instance has been started. Therefore,
b1b7198
-            using glob patterns with <command>start</command>
b1b7198
-            has limited usefulness.</para>
b1b7198
+            <para>Note that glob patterns operate on the set of primary names of currently loaded units. Units which
b1b7198
+            are not active and are not in a failed state usually are not loaded, and will not be matched by any
b1b7198
+            pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
b1b7198
+            the instance has been started. Therefore, using glob patterns with <command>start</command> has limited
b1b7198
+            usefulness. Also, secondary alias names of units are not considered.</para>
b1b7198
           </listitem>
b1b7198
         </varlistentry>
b1b7198
         <varlistentry>
b1b7198
@@ -1701,11 +1698,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
b1b7198
       are equivalent to:
b1b7198
       <programlisting># systemctl status dev-sda.device
b1b7198
 # systemctl status home.mount</programlisting>
b1b7198
-      In the second case, shell-style globs will be matched against
b1b7198
-      currently loaded units; literal unit names, with or without
b1b7198
-      a suffix, will be treated as in the first case. This means that
b1b7198
-      literal unit names always refer to exactly one unit, but globs
b1b7198
-      may match zero units and this is not considered an error.</para>
b1b7198
+      In the second case, shell-style globs will be matched against the primary names of all currently loaded units;
b1b7198
+      literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
b1b7198
+      names always refer to exactly one unit, but globs may match zero units and this is not considered an
b1b7198
+      error.</para>
b1b7198
 
b1b7198
       <para>Glob patterns use
b1b7198
       <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
b1b7198
@@ -1713,11 +1709,12 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
b1b7198
       <literal>*</literal>, <literal>?</literal>,
b1b7198
       <literal>[]</literal> may be used. See
b1b7198
       <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
b1b7198
-      for more details. The patterns are matched against the names of
b1b7198
+      for more details. The patterns are matched against the primary names of
b1b7198
       currently loaded units, and patterns which do not match anything
b1b7198
       are silently skipped. For example:
b1b7198
       <programlisting># systemctl stop sshd@*.service</programlisting>
b1b7198
-      will stop all <filename>sshd@.service</filename> instances.
b1b7198
+      will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
b1b7198
+      loaded are not considered for glob expansion.
b1b7198
       </para>
b1b7198
 
b1b7198
       <para>For unit file commands, the specified
b1b7198
-- 
b1b7198
2.5.0
b1b7198