[systemd-commits] 6 commits - man/loginctl.xml man/machinectl.xml man/systemctl.xml src/kernel-install src/login src/machine src/systemctl src/timedate TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun Dec 8 16:20:54 PST 2013


 TODO                              |    2 
 man/loginctl.xml                  |   69 ++++++++---------
 man/machinectl.xml                |   10 +-
 man/systemctl.xml                 |   74 ++++++++++++++++--
 src/kernel-install/kernel-install |   21 +++--
 src/login/loginctl.c              |   46 +++++------
 src/machine/machinectl.c          |   10 +-
 src/systemctl/systemctl.c         |  150 +++++++++++++++++---------------------
 src/timedate/timedatectl.c        |   27 +++---
 9 files changed, 227 insertions(+), 182 deletions(-)

New commits:
commit 171754aa4ae37a6ab626878256f7b664da78ef55
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 18:56:16 2013 -0500

    man: document 'is-enabled' output
    
    https://bugzilla.redhat.com/show_bug.cgi?id=953077

diff --git a/man/systemctl.xml b/man/systemctl.xml
index 9cd6e88..5e55f29 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -443,7 +443,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
         <listitem>
           <para>When used with <command>enable</command>,
-          <command>disable</command>, <command>is-enabled</command>
+          <command>disable</command>,
           (and related commands), make changes only temporarily, so
           that they are lost on the next reboot. This will have the
           effect that changes are not made in subdirectories of
@@ -920,10 +920,64 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
 
           <listitem>
             <para>Checks whether any of the specified unit files are
-            enabled (as with <command>enable</command>). Returns an exit
-            code of 0 if at least one is enabled, non-zero
-            otherwise. Prints the current enable status. To suppress
-            this output, use <option>--quiet</option>.</para>
+            enabled (as with <command>enable</command>). Returns an
+            exit code of 0 if at least one is enabled, non-zero
+            otherwise. Prints the current enable status (see table).
+            To suppress this output, use <option>--quiet</option>.
+            </para>
+
+            <table>
+              <title>
+                <command>is-enabled</command> output
+              </title>
+
+              <tgroup cols='3'>
+                <thead>
+                  <row>
+                    <entry>Printed string</entry>
+                    <entry>Meaning</entry>
+                    <entry>Return value</entry>
+                  </row>
+                </thead>
+                <tbody>
+                  <row>
+                    <entry><literal>enabled</literal></entry>
+                    <entry morerows='1'>Enabled through a symlink in <filename>.wants</filename> directory (permanently or just in <filename>/run</filename>)</entry>
+                    <entry morerows='1'>0</entry>
+                  </row>
+                  <row>
+                    <entry><literal>enabled-runtime</literal></entry>
+                  </row>
+                  <row>
+                    <entry><literal>linked</literal></entry>
+                    <entry morerows='1'>Made available through a symlink to the unit file (permanently or just in <filename>/run</filename>)</entry>
+                    <entry morerows='1'>1</entry>
+                  </row>
+                  <row>
+                    <entry><literal>linked-runtime</literal></entry>
+                  </row>
+                  <row>
+                    <entry><literal>masked</literal></entry>
+                    <entry morerows='1'>Disabled entirely (permanently or just in <filename>/run</filename>)</entry>
+                    <entry morerows='1'>1</entry>
+                  </row>
+                  <row>
+                    <entry><literal>masked-runtime</literal></entry>
+                  </row>
+                  <row>
+                    <entry><literal>static</literal></entry>
+                    <entry>Unit is not enabled, but has no provisions for enabling in [Install] section</entry>
+                    <entry>1</entry>
+                  </row>
+                  <row>
+                    <entry><literal>disabled</literal></entry>
+                    <entry>Unit is not enabled</entry>
+                    <entry>1</entry>
+                  </row>
+                </tbody>
+              </tgroup>
+            </table>
+
           </listitem>
         </varlistentry>
 

commit 04504f93d147b12687d0745e50923740b10138c5
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 17:51:25 2013 -0500

    systemctl: fix 'is-enabled'

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 1ab2733..24a74c3 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4766,7 +4766,7 @@ static int unit_is_enabled(sd_bus *bus, char **args) {
                                         "GetUnitFileState",
                                         &error,
                                         &reply,
-                                        "s", name);
+                                        "s", *name);
                         if (r < 0) {
                                 log_error("Failed to get unit file state for %s: %s", *name, bus_error_message(&error, r));
                                 return r;

commit d08e75edf9d44540d9744349fc0c47dfb4a7eec8
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 17:50:25 2013 -0500

    systemctl: simplify argument parsing

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2022f13..1ab2733 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5813,9 +5813,13 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 } argc_cmp;
                 const int argc;
                 int (* const dispatch)(sd_bus *bus, char **args);
+                const enum {
+                        NOBUS = 1,
+                        FORCE,
+                } bus;
         } verbs[] = {
                 { "list-units",            MORE,  0, list_units        },
-                { "list-unit-files",       MORE,  1, list_unit_files   },
+                { "list-unit-files",       MORE,  1, list_unit_files,  NOBUS },
                 { "list-sockets",          MORE,  1, list_sockets      },
                 { "list-timers",           MORE,  1, list_timers       },
                 { "list-jobs",             MORE,  1, list_jobs         },
@@ -5848,9 +5852,9 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 { "show-environment",      EQUAL, 1, show_environment  },
                 { "set-environment",       MORE,  2, set_environment   },
                 { "unset-environment",     MORE,  2, set_environment   },
-                { "halt",                  EQUAL, 1, start_special     },
-                { "poweroff",              EQUAL, 1, start_special     },
-                { "reboot",                EQUAL, 1, start_special     },
+                { "halt",                  EQUAL, 1, start_special,    FORCE },
+                { "poweroff",              EQUAL, 1, start_special,    FORCE },
+                { "reboot",                EQUAL, 1, start_special,    FORCE },
                 { "kexec",                 EQUAL, 1, start_special     },
                 { "suspend",               EQUAL, 1, start_special     },
                 { "hibernate",             EQUAL, 1, start_special     },
@@ -5860,53 +5864,50 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 { "emergency",             EQUAL, 1, start_special     },
                 { "exit",                  EQUAL, 1, start_special     },
                 { "reset-failed",          MORE,  1, reset_failed      },
-                { "enable",                MORE,  2, enable_unit       },
-                { "disable",               MORE,  2, enable_unit       },
-                { "is-enabled",            MORE,  2, unit_is_enabled   },
-                { "reenable",              MORE,  2, enable_unit       },
-                { "preset",                MORE,  2, enable_unit       },
-                { "mask",                  MORE,  2, enable_unit       },
-                { "unmask",                MORE,  2, enable_unit       },
-                { "link",                  MORE,  2, enable_unit       },
+                { "enable",                MORE,  2, enable_unit,      NOBUS },
+                { "disable",               MORE,  2, enable_unit,      NOBUS },
+                { "is-enabled",            MORE,  2, unit_is_enabled,  NOBUS },
+                { "reenable",              MORE,  2, enable_unit,      NOBUS },
+                { "preset",                MORE,  2, enable_unit,      NOBUS },
+                { "mask",                  MORE,  2, enable_unit,      NOBUS },
+                { "unmask",                MORE,  2, enable_unit,      NOBUS },
+                { "link",                  MORE,  2, enable_unit,      NOBUS },
                 { "switch-root",           MORE,  2, switch_root       },
                 { "list-dependencies",     LESS,  2, list_dependencies },
-                { "set-default",           EQUAL, 2, set_default       },
-                { "get-default",           EQUAL, 1, get_default       },
+                { "set-default",           EQUAL, 2, set_default,      NOBUS },
+                { "get-default",           EQUAL, 1, get_default,      NOBUS },
                 { "set-property",          MORE,  3, set_property      },
-        };
+                {}
+        }, *verb = verbs;
 
         int left;
-        unsigned i;
 
         assert(argc >= 0);
         assert(argv);
 
         left = argc - optind;
 
-        if (left <= 0)
-                /* Special rule: no arguments means "list-units" */
-                i = 0;
-        else {
+        /* Special rule: no arguments (left == 0) means "list-units" */
+        if (left > 0) {
                 if (streq(argv[optind], "help") && !argv[optind+1]) {
                         log_error("This command expects one or more "
                                   "unit names. Did you mean --help?");
                         return -EINVAL;
                 }
 
-                for (i = 0; i < ELEMENTSOF(verbs); i++)
-                        if (streq(argv[optind], verbs[i].verb))
-                                break;
+                for (; verb->verb; verb++)
+                        if (streq(argv[optind], verb->verb))
+                                goto found;
 
-                if (i >= ELEMENTSOF(verbs)) {
-                        log_error("Unknown operation '%s'.", argv[optind]);
-                        return -EINVAL;
-                }
+                log_error("Unknown operation '%s'.", argv[optind]);
+                return -EINVAL;
         }
+found:
 
-        switch (verbs[i].argc_cmp) {
+        switch (verb->argc_cmp) {
 
         case EQUAL:
-                if (left != verbs[i].argc) {
+                if (left != verb->argc) {
                         log_error("Invalid number of arguments.");
                         return -EINVAL;
                 }
@@ -5914,7 +5915,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 break;
 
         case MORE:
-                if (left < verbs[i].argc) {
+                if (left < verb->argc) {
                         log_error("Too few arguments.");
                         return -EINVAL;
                 }
@@ -5922,7 +5923,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 break;
 
         case LESS:
-                if (left > verbs[i].argc) {
+                if (left > verb->argc) {
                         log_error("Too many arguments.");
                         return -EINVAL;
                 }
@@ -5935,39 +5936,25 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
 
         /* Require a bus connection for all operations but
          * enable/disable */
-        if (!streq(verbs[i].verb, "enable") &&
-            !streq(verbs[i].verb, "disable") &&
-            !streq(verbs[i].verb, "is-enabled") &&
-            !streq(verbs[i].verb, "list-unit-files") &&
-            !streq(verbs[i].verb, "reenable") &&
-            !streq(verbs[i].verb, "preset") &&
-            !streq(verbs[i].verb, "mask") &&
-            !streq(verbs[i].verb, "unmask") &&
-            !streq(verbs[i].verb, "link") &&
-            !streq(verbs[i].verb, "set-default") &&
-            !streq(verbs[i].verb, "get-default")) {
+        if (verb->bus == NOBUS) {
+                if (!bus && !avoid_bus()) {
+                        log_error("Failed to get D-Bus connection: %s", strerror(-bus_error));
+                        return -EIO;
+                }
 
+        } else {
                 if (running_in_chroot() > 0) {
                         log_info("Running in chroot, ignoring request.");
                         return 0;
                 }
 
-                if (((!streq(verbs[i].verb, "reboot") &&
-                      !streq(verbs[i].verb, "halt") &&
-                      !streq(verbs[i].verb, "poweroff")) || arg_force <= 0) && !bus) {
-                        log_error("Failed to get D-Bus connection: %s", strerror (-bus_error));
-                        return -EIO;
-                }
-
-        } else {
-
-                if (!bus && !avoid_bus()) {
-                        log_error("Failed to get D-Bus connection: %s", strerror (-bus_error));
+                if ((verb->bus != FORCE || arg_force <= 0) && !bus) {
+                        log_error("Failed to get D-Bus connection: %s", strerror(-bus_error));
                         return -EIO;
                 }
         }
 
-        return verbs[i].dispatch(bus, argv + optind);
+        return verb->dispatch(bus, argv + optind);
 }
 
 static int send_shutdownd(usec_t t, char mode, bool dry_run, bool warn, const char *message) {

commit 4f8f66cb4236783cd3cbee97fefc9aaa8469ac08
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 08:16:59 2013 -0500

    Help output spring cleaning
    
    Use [brackets] only for optional elements.
    Use <optional> in XML sources.

diff --git a/man/loginctl.xml b/man/loginctl.xml
index d9e9859..eb4a2fd 100644
--- a/man/loginctl.xml
+++ b/man/loginctl.xml
@@ -201,7 +201,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>session-status [ID...]</command></term>
+                                <term><command>session-status</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Show terse runtime
                                 status information about one or more
@@ -214,7 +214,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>show-session [ID...]</command></term>
+                                <term><command>show-session</command> <optional><replaceable>ID</replaceable>...</optional></term>
 
                                 <listitem><para>Show properties of one
                                 or more sessions or the manager
@@ -237,7 +237,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>activate [ID...]</command></term>
+                                <term><command>activate</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Activate one or more
                                 sessions. This brings one or more
@@ -248,12 +248,13 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>lock-session [ID...]</command></term>
-                                <term><command>unlock-session [ID...]</command></term>
+                                <term><command>lock-session</command> <replaceable>ID</replaceable>...</term>
+                                <term><command>unlock-session</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Activates/deactivates
                                 the screen lock on one or more
-                                sessions, if the session supports it.</para></listitem>
+                                sessions, if the session supports it.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
@@ -262,22 +263,22 @@
 
                                 <listitem><para>Activates/deactivates
                                 the screen lock on all current
-                                sessions supporting
-                                it.</para></listitem>
+                                sessions supporting it.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>terminate-session [ID...]</command></term>
+                                <term><command>terminate-session</command> <replaceable>ID</replaceable>...</term>
 
-                                <listitem><para>Terminates a
-                                session. This kills all processes of
-                                the session and deallocates all
-                                resources attached to the
-                                session.</para></listitem>
+                                <listitem><para>Terminates a session.
+                                This kills all processes of the
+                                session and deallocates all resources
+                                attached to the session.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>kill-session [ID...]</command></term>
+                                <term><command>kill-session</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Send a signal to one
                                 or more processes of the session. Use
@@ -295,7 +296,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>user-status [USER...]</command></term>
+                                <term><command>user-status</command> <replaceable>USER</replaceable>...</term>
 
                                 <listitem><para>Show terse runtime
                                 status information about one or more
@@ -303,14 +304,14 @@
                                 intended to generate human-readable
                                 output. If you are looking for
                                 computer-parsable output, use
-                                <command>show-user</command>
-                                instead. Users may be specified by
-                                their usernames or numeric user
-                                IDs.</para></listitem>
+                                <command>show-user</command> instead.
+                                Users may be specified by their
+                                usernames or numeric user IDs.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>show-user [USER...]</command></term>
+                                <term><command>show-user</command> <optional><replaceable>USER</replaceable>...</optional></term>
 
                                 <listitem><para>Show properties of one
                                 or more users or the manager
@@ -333,13 +334,13 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>enable-linger [USER...]</command></term>
-                                <term><command>disable-linger [USER...]</command></term>
+                                <term><command>enable-linger</command> <replaceable>USER</replaceable>...</term>
+                                <term><command>disable-linger</command> <replaceable>USER</replaceable>...</term>
 
                                 <listitem><para>Enable/disable user
                                 lingering for one or more users. If
                                 enabled for a specific user, a user
-                                manager is spawned for him/her at
+                                manager is spawned for the user at
                                 boot and kept around after
                                 logouts. This allows users who are not
                                 logged in to run long-running
@@ -347,18 +348,18 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>terminate-user [USER...]</command></term>
+                                <term><command>terminate-user</command> <replaceable>USER</replaceable>...</term>
 
                                 <listitem><para>Terminates all
                                 sessions of a user. This kills all
                                 processes of all sessions of the user
                                 and deallocates all runtime resources
-                                attached to the
-                                user.</para></listitem>
+                                attached to the user.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>kill-user [USER...]</command></term>
+                                <term><command>kill-user</command> <replaceable>USER</replaceable>...</term>
 
                                 <listitem><para>Send a signal to all
                                 processes of a user. Use
@@ -375,7 +376,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>seat-status [NAME...]</command></term>
+                                <term><command>seat-status</command> <replaceable>NAME</replaceable>...</term>
 
                                 <listitem><para>Show terse runtime
                                 status information about one or more
@@ -388,7 +389,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>show-seat [NAME...]</command></term>
+                                <term><command>show-seat</command> <replaceable>NAME</replaceable>...</term>
 
                                 <listitem><para>Show properties of one
                                 or more seats or the manager
@@ -411,7 +412,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>attach [NAME] [DEVICE...]</command></term>
+                                <term><command>attach</command> <replaceable>NAME</replaceable> <replaceable>DEVICE</replaceable>...</term>
 
                                 <listitem><para>Persistently attach
                                 one or more devices to a seat. The
@@ -444,12 +445,12 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>terminate-seat [NAME...]</command></term>
+                                <term><command>terminate-seat</command> <replaceable>NAME</replaceable>...</term>
 
                                 <listitem><para>Terminates all
                                 sessions on a seat. This kills all
-                                processes of all sessions on a seat and
-                                deallocates all runtime resources
+                                processes of all sessions on the seat
+                                and deallocates all runtime resources
                                 attached to them.</para></listitem>
                         </varlistentry>
                 </variablelist>
diff --git a/man/machinectl.xml b/man/machinectl.xml
index ec2aaa5..6e991ee 100644
--- a/man/machinectl.xml
+++ b/man/machinectl.xml
@@ -202,7 +202,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>status [ID...]</command></term>
+                                <term><command>status</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Show terse runtime
                                 status information about one or more
@@ -215,7 +215,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>show [ID...]</command></term>
+                                <term><command>show</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Show properties of one
                                 or more registered virtual machines or
@@ -239,7 +239,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>terminate [ID...]</command></term>
+                                <term><command>terminate</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Terminates a virtual
                                 machine or container. This kills all
@@ -250,7 +250,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>kill [ID...]</command></term>
+                                <term><command>kill</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Send a signal to one
                                 or more processes of the virtual
@@ -265,7 +265,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><command>login [ID]</command></term>
+                                <term><command>login</command> <replaceable>ID</replaceable>...</term>
 
                                 <listitem><para>Open a terminal login
                                 session to a container. This will
diff --git a/man/systemctl.xml b/man/systemctl.xml
index ce28602..9cd6e88 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -526,7 +526,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
       <variablelist>
         <varlistentry>
-          <term><command>list-units <optional><replaceable>PATTERN...</replaceable></optional></command></term>
+          <term><command>list-units <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
 
           <listitem>
             <para>List known units (subject to limitations specified
@@ -539,7 +539,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
         </varlistentry>
 
         <varlistentry>
-          <term><command>list-sockets <optional><replaceable>PATTERN...</replaceable></optional></command></term>
+          <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
 
           <listitem>
             <para>List socket units ordered by the listening address.
@@ -565,7 +565,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
         </varlistentry>
 
         <varlistentry>
-          <term><command>list-timers <optional><replaceable>PATTERN...</replaceable></optional></command></term>
+          <term><command>list-timers <optional><replaceable>PATTERN</replaceable>...</optional></command></term>
 
           <listitem>
             <para>List timer units ordered by the time they elapse
@@ -708,7 +708,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
           </listitem>
         </varlistentry>
         <varlistentry>
-          <term><command>status [<replaceable>NAME</replaceable>...|<replaceable>PID</replaceable>...]</command></term>
+          <term><command>status</command> <optional><replaceable>NAME</replaceable>...|<replaceable>PID</replaceable>...]</optional></term>
 
           <listitem>
             <para>Show terse runtime status information about one or
@@ -724,7 +724,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
           </listitem>
         </varlistentry>
         <varlistentry>
-          <term><command>show [<replaceable>NAME</replaceable>...|<replaceable>JOB</replaceable>...]</command></term>
+          <term><command>show</command> <optional><replaceable>NAME</replaceable>...|<replaceable>JOB</replaceable>...</optional></term>
 
           <listitem>
             <para>Show properties of one or more units, jobs, or the
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 5547cb2..f96a568 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -1037,29 +1037,29 @@ static int help(void) {
                "     --kill-who=WHO      Who to send signal to\n"
                "  -s --signal=SIGNAL     Which signal to send\n\n"
                "Commands:\n"
-               "  list-sessions                   List sessions\n"
-               "  session-status [ID...]          Show session status\n"
-               "  show-session [ID...]            Show properties of one or more sessions\n"
-               "  activate [ID]                   Activate a session\n"
-               "  lock-session [ID...]            Screen lock one or more sessions\n"
-               "  unlock-session [ID...]          Screen unlock one or more sessions\n"
-               "  lock-sessions                   Screen lock all current sessions\n"
-               "  unlock-sessions                 Screen unlock all current sessions\n"
-               "  terminate-session [ID...]       Terminate one or more sessions\n"
-               "  kill-session [ID...]            Send signal to processes of a session\n"
-               "  list-users                      List users\n"
-               "  user-status [USER...]           Show user status\n"
-               "  show-user [USER...]             Show properties of one or more users\n"
-               "  enable-linger [USER...]         Enable linger state of one or more users\n"
-               "  disable-linger [USER...]        Disable linger state of one or more users\n"
-               "  terminate-user [USER...]        Terminate all sessions of one or more users\n"
-               "  kill-user [USER...]             Send signal to processes of a user\n"
-               "  list-seats                      List seats\n"
-               "  seat-status [NAME...]           Show seat status\n"
-               "  show-seat [NAME...]             Show properties of one or more seats\n"
-               "  attach [NAME] [DEVICE...]       Attach one or more devices to a seat\n"
-               "  flush-devices                   Flush all device associations\n"
-               "  terminate-seat [NAME...]        Terminate all sessions on one or more seats\n",
+               "  list-sessions            List sessions\n"
+               "  session-status ID...     Show session status\n"
+               "  show-session [ID...]     Show properties of sessions or the manager\n"
+               "  activate ID              Activate a session\n"
+               "  lock-session ID...       Screen lock one or more sessions\n"
+               "  unlock-session ID...     Screen unlock one or more sessions\n"
+               "  lock-sessions            Screen lock all current sessions\n"
+               "  unlock-sessions          Screen unlock all current sessions\n"
+               "  terminate-session ID...  Terminate one or more sessions\n"
+               "  kill-session ID...       Send signal to processes of a session\n"
+               "  list-users               List users\n"
+               "  user-status USER...      Show user status\n"
+               "  show-user [USER...]      Show properties of users or the manager\n"
+               "  enable-linger USER...    Enable linger state of one or more users\n"
+               "  disable-linger USER...   Disable linger state of one or more users\n"
+               "  terminate-user USER...   Terminate all sessions of one or more users\n"
+               "  kill-user USER...        Send signal to processes of a user\n"
+               "  list-seats               List seats\n"
+               "  seat-status NAME...      Show seat status\n"
+               "  show-seat NAME...        Show properties of one or more seats\n"
+               "  attach NAME DEVICE...    Attach one or more devices to a seat\n"
+               "  flush-devices            Flush all device associations\n"
+               "  terminate-seat NAME...   Terminate all sessions on one or more seats\n",
                program_invocation_short_name);
 
         return 0;
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 61fb813..7bb7086 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -639,11 +639,11 @@ static int help(void) {
                "  -s --signal=SIGNAL     Which signal to send\n\n"
                "Commands:\n"
                "  list                   List running VMs and containers\n"
-               "  status [NAME...]       Show VM/container status\n"
-               "  show [NAME...]         Show properties of one or more VMs/containers\n"
-               "  terminate [NAME...]    Terminate one or more VMs/containers\n"
-               "  kill [NAME...]         Send signal to processes of a VM/container\n"
-               "  login [NAME]           Get a login prompt on a container\n",
+               "  status NAME...         Show VM/container status\n"
+               "  show NAME...           Show properties of one or more VMs/containers\n"
+               "  terminate NAME...      Terminate one or more VMs/containers\n"
+               "  kill NAME...           Send signal to processes of a VM/container\n"
+               "  login NAME             Get a login prompt on a container\n",
                program_invocation_short_name);
 
         return 0;
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 16dfddb..2022f13 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4839,26 +4839,25 @@ static int systemctl_help(void) {
                "  list-units [PATTERN...]         List loaded units\n"
                "  list-sockets [PATTERN...]       List loaded sockets ordered by address\n"
                "  list-timers [PATTERN...]        List loaded timers ordered by next elapse\n"
-               "  start [NAME...]                 Start (activate) one or more units\n"
-               "  stop [NAME...]                  Stop (deactivate) one or more units\n"
-               "  reload [NAME...]                Reload one or more units\n"
-               "  restart [NAME...]               Start or restart one or more units\n"
-               "  try-restart [NAME...]           Restart one or more units if active\n"
-               "  reload-or-restart [NAME...]     Reload one or more units if possible,\n"
+               "  start NAME...                   Start (activate) one or more units\n"
+               "  stop NAME...                    Stop (deactivate) one or more units\n"
+               "  reload NAME...                  Reload one or more units\n"
+               "  restart NAME...                 Start or restart one or more units\n"
+               "  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"
+               "  reload-or-try-restart NAME...   Reload one or more units if possible,\n"
                "                                  otherwise restart if active\n"
-               "  isolate [NAME]                  Start one unit and stop all others\n"
-               "  kill [NAME...]                  Send signal to processes of a unit\n"
-               "  is-active [NAME...]             Check whether units are active\n"
-               "  is-failed [NAME...]             Check whether units are failed\n"
+               "  isolate NAME                    Start one unit and stop all others\n"
+               "  kill NAME...                    Send signal to processes of a unit\n"
+               "  is-active NAME...               Check whether units are active\n"
+               "  is-failed NAME...               Check whether units are failed\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"
-               "  cat [NAME...]                   Show files and drop-ins of one or more units\n"
-               "  set-property [NAME] [ASSIGNMENT...]\n"
-               "                                  Sets one or more properties of a unit\n"
-               "  help [NAME...|PID...]           Show manual for one or more units\n"
+               "  cat NAME...                     Show files and drop-ins of one or more units\n"
+               "  set-property NAME ASSIGNMENT... Sets one or more properties of a unit\n"
+               "  help NAME...|PID...             Show manual for one or more units\n"
                "  reset-failed [NAME...]          Reset failed state for all, one, or more\n"
                "                                  units\n"
                "  list-dependencies [NAME]        Recursively show units which are required\n"
@@ -4866,15 +4865,15 @@ static int systemctl_help(void) {
                "                                  unit is required or wanted\n\n"
                "Unit File Commands:\n"
                "  list-unit-files [PATTERN...]    List installed unit files\n"
-               "  enable [NAME...]                Enable one or more unit files\n"
-               "  disable [NAME...]               Disable one or more unit files\n"
-               "  reenable [NAME...]              Reenable one or more unit files\n"
-               "  preset [NAME...]                Enable/disable one or more unit files\n"
+               "  enable NAME...                  Enable one or more unit files\n"
+               "  disable NAME...                 Disable one or more unit files\n"
+               "  reenable NAME...                Reenable one or more unit files\n"
+               "  preset NAME...                  Enable/disable one or more unit files\n"
                "                                  based on preset configuration\n"
-               "  is-enabled [NAME...]            Check whether unit files are enabled\n\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"
+               "  is-enabled NAME...              Check whether unit files are enabled\n\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"
                "                                  the search path\n"
                "  get-default                     Get the name of the default target\n"
                "  set-default NAME                Set the default target\n\n"
@@ -4883,11 +4882,11 @@ static int systemctl_help(void) {
                "  cancel [JOB...]                 Cancel all, one, or more jobs\n\n"
                "Snapshot Commands:\n"
                "  snapshot [NAME]                 Create a snapshot\n"
-               "  delete [NAME...]                Remove one or more snapshots\n\n"
+               "  delete NAME...                  Remove one or more snapshots\n\n"
                "Environment Commands:\n"
                "  show-environment                Dump environment\n"
-               "  set-environment [NAME=VALUE...] Set one or more environment variables\n"
-               "  unset-environment [NAME...]     Unset one or more environment variables\n\n"
+               "  set-environment NAME=VALUE...   Set one or more environment variables\n"
+               "  unset-environment NAME...       Unset one or more environment variables\n\n"
                "Manager Lifecycle Commands:\n"
                "  daemon-reload                   Reload systemd manager configuration\n"
                "  daemon-reexec                   Reexecute systemd manager\n\n"
@@ -4900,7 +4899,7 @@ static int systemctl_help(void) {
                "  reboot [ARG]                    Shut down and reboot the system\n"
                "  kexec                           Shut down and reboot the system with kexec\n"
                "  exit                            Request user instance exit\n"
-               "  switch-root [ROOT] [INIT]       Change to a different root file system\n"
+               "  switch-root ROOT [INIT]         Change to a different root file system\n"
                "  suspend                         Suspend the system\n"
                "  hibernate                       Hibernate the system\n"
                "  hybrid-sleep                    Hibernate and suspend the system\n",
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 6a36af0..6e0bc3c 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -410,21 +410,20 @@ static int help(void) {
 
         printf("%s [OPTIONS...] COMMAND ...\n\n"
                "Query or change system time and date settings.\n\n"
-               "  -h --help              Show this help\n"
-               "     --version           Show package version\n"
-               "     --no-pager          Do not pipe output into a pager\n"
-               "     --no-ask-password   Do not prompt for password\n"
-               "  -H --host=[USER@]HOST  Operate on remote host\n"
-               "  -M --machine=CONTAINER Operate on local container\n"
-               "     --adjust-system-clock\n"
-               "                         Adjust system clock when changing local RTC mode\n\n"
+               "  -h --help                Show this help\n"
+               "     --version             Show package version\n"
+               "     --no-pager            Do not pipe output into a pager\n"
+               "     --no-ask-password     Do not prompt for password\n"
+               "  -H --host=[USER@]HOST    Operate on remote host\n"
+               "  -M --machine=CONTAINER   Operate on local container\n"
+               "     --adjust-system-clock Adjust system clock when changing local RTC mode\n\n"
                "Commands:\n"
-               "  status                 Show current time settings\n"
-               "  set-time TIME          Set system time\n"
-               "  set-timezone ZONE      Set system timezone\n"
-               "  list-timezones         Show known timezones\n"
-               "  set-local-rtc BOOL     Control whether RTC is in local time\n"
-               "  set-ntp BOOL           Control whether NTP is enabled\n",
+               "  status                   Show current time settings\n"
+               "  set-time TIME            Set system time\n"
+               "  set-timezone ZONE        Set system timezone\n"
+               "  list-timezones           Show known timezones\n"
+               "  set-local-rtc BOOL       Control whether RTC is in local time\n"
+               "  set-ntp BOOL             Control whether NTP is enabled\n",
                program_invocation_short_name);
 
         return 0;

commit a6c3d202b14939006f39e22179a058159a8512fb
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 07:46:46 2013 -0500

    kernel-install: add -h/--help

diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
index 9d3e75d..f5ff362 100644
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -21,9 +21,9 @@
 
 usage()
 {
-    echo "Usage:" >&2
-    echo "        $0 add <kernel-version> <kernel-image>" >&2
-    echo "        $0 remove <kernel-version> <kernel-image>" >&2
+    echo "Usage:"
+    echo "        $0 add KERNEL-VERSION KERNEL-IMAGE"
+    echo "        $0 remove KERNEL-VERSION KERNEL-IMAGE"
 }
 
 dropindirs_sort()
@@ -54,6 +54,13 @@ dropindirs_sort()
 
 export LC_COLLATE=C
 
+for i in "$@"; do
+    if [ "$i" == "--help" -o "$i" == "-h" ]; then
+        usage
+        exit 0
+    fi
+done
+
 if [[ "${0##*/}" == 'installkernel' ]]; then
     COMMAND='add'
 else
@@ -75,7 +82,7 @@ if ! [[ $MACHINE_ID ]]; then
 fi
 
 if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then
-    usage
+    echo "Not enough arguments" >&2
     exit 1
 fi
 
@@ -90,8 +97,8 @@ readarray -t PLUGINS < <(
 
 case $COMMAND in
     add)
-        if [[ ! $KERNEL_IMAGE ]]; then
-            usage
+        if [[ ! "$KERNEL_IMAGE" ]]; then
+            echo "Command 'add' requires an argument" >&2
             exit 1
         fi
 
@@ -121,7 +128,7 @@ case $COMMAND in
         ;;
 
     *)
-        usage
+        echo "Unknown command '$COMMAND'" >&2
         exit 1
         ;;
 esac

commit 014e7ea7f2361e9431926fca1959d868b9f3a430
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Dec 8 06:46:07 2013 -0500

    Trim TODO

diff --git a/TODO b/TODO
index 9698082..8f9aabc 100644
--- a/TODO
+++ b/TODO
@@ -4,8 +4,6 @@ Bugfixes:
     $ systemctl enable getty at .service
     ln -s '/usr/lib/systemd/system/getty at .service' '/etc/systemd/system/getty.target.wants/getty at .service'
 
-* swap units that are activated by one name but shown in the kernel under another are semi-broken
-
 * Dangling symlinks of .automount unit files in .wants/ directories, set up
   automount points even when the original .automount file did not exist
   anymore. Only the .mount unit was still around.



More information about the systemd-commits mailing list