[systemd-commits] 5 commits - man/systemctl.xml man/systemd.unit.xml shell-completion/bash shell-completion/zsh src/shared src/systemctl TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sat Nov 30 19:37:37 PST 2013


 TODO                             |    1 
 man/systemctl.xml                |    9 ++
 man/systemd.unit.xml             |  128 +++++++++++++++++++++------------------
 shell-completion/bash/systemctl  |    2 
 shell-completion/zsh/_loginctl   |    2 
 shell-completion/zsh/_machinectl |    2 
 shell-completion/zsh/_systemctl  |    5 -
 src/shared/fileio.c              |   73 +++++++++++++++++++++-
 src/shared/fileio.h              |    1 
 src/shared/util.c                |    2 
 src/systemctl/systemctl.c        |  122 ++++++++++++++++++++++++++++++-------
 11 files changed, 259 insertions(+), 88 deletions(-)

New commits:
commit 6da49b8b2f78fd74bb33de961ef8a4c7f727b822
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat Nov 30 22:31:31 2013 -0500

    shell-completion: systemctl cat
    
    Also update -H help string to follow the binaries.

diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl
index bb2b8ad..e96b1f2 100644
--- a/shell-completion/bash/systemctl
+++ b/shell-completion/bash/systemctl
@@ -123,7 +123,7 @@ _systemctl () {
         fi
 
         local -A VERBS=(
-                [ALL_UNITS]='is-active is-failed is-enabled status show mask preset help list-dependencies'
+                [ALL_UNITS]='is-active is-failed is-enabled status show cat mask preset help list-dependencies'
             [ENABLED_UNITS]='disable'
            [DISABLED_UNITS]='enable'
         [REENABLABLE_UNITS]='reenable'
diff --git a/shell-completion/zsh/_loginctl b/shell-completion/zsh/_loginctl
index ebf6b3a..a22fc99 100644
--- a/shell-completion/zsh/_loginctl
+++ b/shell-completion/zsh/_loginctl
@@ -100,7 +100,7 @@ _arguments -s \
     '--kill-who=[Who to send signal to]:killwho:(main control all)' \
     {-s+,--signal=}'[Which signal to send]:signal:_signals' \
     '--no-ask-password[Do not ask for system passwords]' \
-    {-H+,--host=}'[Show information for remote host]:userathost:_sd_hosts_or_user_at_host' \
+    {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
     {-P,--privileged}'[Acquire privileges before execution]' \
     '--no-pager[Do not pipe output into a pager]' \
     '*::loginctl command:_loginctl_command'
diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl
index 026d74f..15c149f 100644
--- a/shell-completion/zsh/_machinectl
+++ b/shell-completion/zsh/_machinectl
@@ -37,6 +37,6 @@ _arguments \
   '--no-ask-password[Do not ask for system passwords]' \
   '--kill-who=[Who to send signal to]:killwho:(leader all)' \
   {-s+,--signal=}'[Which signal to send]:signal:_signals' \
-  {-H+,--host=}'[Show information for remote host]:userathost:_sd_hosts_or_user_at_host' \
+  {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
   {-P,--privileged}'[Acquire privileges before execution]' \
   '*::machinectl command:_machinectl_command'
diff --git a/shell-completion/zsh/_systemctl b/shell-completion/zsh/_systemctl
index f5680d2..c469d5f 100644
--- a/shell-completion/zsh/_systemctl
+++ b/shell-completion/zsh/_systemctl
@@ -24,6 +24,7 @@
     "is-failed:Check whether units are failed"
     "status:Show runtime status of one or more units"
     "show:Show properties of one or more units/jobs or the manager"
+    "cat:Show the source unit files and drop-ins"
     "reset-failed:Reset failed state for all, one, or more units"
     "load:Load one or more units"
     "list-unit-files:List installed unit files"
@@ -146,7 +147,7 @@ _systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files
 _systemctl_masked_units()  {_sys_masked_units=(  $(__systemctl list-unit-files     | { while read a b; do [[ $b == "masked" ]] && echo " $a"; done; }) )}
 
 # Completion functions for ALL_UNITS
-for fun in is-active is-failed is-enabled status show mask preset help list-dependencies ; do
+for fun in is-active is-failed is-enabled status show cat mask preset help list-dependencies ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
   {
     _systemctl_really_all_units
@@ -333,7 +334,7 @@ _arguments -s \
     {-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \
     '--root=[Enable unit files in the specified root directory]:directory:_directories' \
     '--runtime[Enable unit files only temporarily until next reboot]' \
-    {-H+,--host=}'[Show information for remote host]:userathost:_sd_hosts_or_user_at_host' \
+    {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
     {-P,--privileged}'[Acquire privileges before execution]' \
     {-n+,--lines=}'[Journal entries to show]:number of entries' \
     {-o+,--output=}'[Change journal output mode]:modes:_sd_outputmodes' \

commit e4c0fbe50c9a4a26efa4ae2b2350215be29b8660
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat Nov 30 22:29:33 2013 -0500

    systemctl: do not show SourcePath when FragmentPath cannot be found
    
    Those files can be in a completely deferent format and also
    arbitrarily long, and usually contain information about other
    stuff. If we ever add SourceLine= or SourceLines= in addition
    to SourcePath=, and can show the relevant information only, this
    commit can be reverted.

diff --git a/man/systemctl.xml b/man/systemctl.xml
index 5a15e5c..a84a983 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -737,10 +737,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
           <term><command>cat <replaceable>NAME</replaceable>...</command></term>
 
           <listitem>
-            <para>Show backing files of one or more units.
-            Prints the fragment, drop-ins, and source (sysvinit compat)
-            of units. Each file is preceded by a comment which includes the
-            file name.</para>
+            <para>Show backing files of one or more units. Prints the
+            "fragment" and "drop-ins" (source files) of units. Each
+            file is preceded by a comment which includes the file
+            name.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f7b2fb4..5dcefd7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3718,23 +3718,6 @@ static int cat(sd_bus *bus, char **args) {
                         continue;
                 }
 
-                if (isempty(fragment_path)) {
-                        free(fragment_path);
-                        fragment_path = NULL;
-
-                        if (sd_bus_get_property_string(
-                                        bus,
-                                        "org.freedesktop.systemd1",
-                                        unit,
-                                        "org.freedesktop.systemd1.Unit",
-                                        "SourcePath",
-                                        &error,
-                                        &fragment_path) < 0) {
-                                log_warning("Failed to get SourcePath: %s", bus_error_message(&error, r));
-                                continue;
-                        }
-                }
-
                 r = sd_bus_get_property_strv(
                                 bus,
                                 "org.freedesktop.systemd1",

commit e93c33d4aadb41427f215d43545e7fadc6bcec6f
Author: Shawn Landden <shawn at churchofgit.com>
Date:   Sat Nov 30 16:09:26 2013 -0800

    systemctl: add "systemctl cat"

diff --git a/TODO b/TODO
index e4acb15..cfabfca 100644
--- a/TODO
+++ b/TODO
@@ -356,7 +356,6 @@ Features:
   - support "systemctl stop foobar at .service" to stop all units matching a certain template
   - Something is wrong with symlink handling of "autovt at .service" in "systemctl list-unit-files"
   - rework wait filter to not require match callback
-  - "systemctl cat" or "systemctl view" command or or so, that cats the backing unit file of a service, plus its drop-ins and shows them in a pager
   - better error message if you run systemctl without systemd running
   - systemctl status output should should include list of triggering units and their status
   - in systemctl list-timers show time trggering units ran last
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 567f398..5a15e5c 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -733,7 +733,16 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
             human-readable output.</para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><command>cat <replaceable>NAME</replaceable>...</command></term>
 
+          <listitem>
+            <para>Show backing files of one or more units.
+            Prints the fragment, drop-ins, and source (sysvinit compat)
+            of units. Each file is preceded by a comment which includes the
+            file name.</para>
+          </listitem>
+        </varlistentry>
         <varlistentry>
           <term><command>set-property <replaceable>NAME</replaceable> <replaceable>ASSIGNMENT</replaceable>...</command></term>
 
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
index 733b320..ac1b409 100644
--- a/src/shared/fileio.c
+++ b/src/shared/fileio.c
@@ -20,6 +20,7 @@
 ***/
 
 #include <unistd.h>
+#include <sys/sendfile.h>
 #include "fileio.h"
 #include "util.h"
 #include "strv.h"
@@ -117,6 +118,77 @@ int read_one_line_file(const char *fn, char **line) {
         return 0;
 }
 
+ssize_t sendfile_full(int out_fd, const char *fn) {
+        _cleanup_fclose_ FILE *f;
+        struct stat st;
+        int r;
+        ssize_t s;
+
+        size_t n, l;
+        _cleanup_free_ char *buf = NULL;
+
+        assert(out_fd > 0);
+        assert(fn);
+
+        f = fopen(fn, "r");
+        if (!f)
+                return -errno;
+
+        r = fstat(fileno(f), &st);
+        if (r < 0)
+                return -errno;
+
+        s = sendfile(out_fd, fileno(f), NULL, st.st_size);
+        if (s < 0)
+                if (errno == EINVAL || errno == ENOSYS) {
+                        /* continue below */
+                } else
+                        return -errno;
+        else
+                return s;
+
+        /* sendfile() failed, fall back to read/write */
+
+        /* Safety check */
+        if (st.st_size > 4*1024*1024)
+                return -E2BIG;
+
+        n = st.st_size > 0 ? st.st_size : LINE_MAX;
+        l = 0;
+
+        while (true) {
+                char *t;
+                size_t k;
+
+                t = realloc(buf, n);
+                if (!t)
+                        return -ENOMEM;
+
+                buf = t;
+                k = fread(buf + l, 1, n - l, f);
+
+                if (k <= 0) {
+                        if (ferror(f))
+                                return -errno;
+
+                        break;
+                }
+
+                l += k;
+                n *= 2;
+
+                /* Safety check */
+                if (n > 4*1024*1024)
+                        return -E2BIG;
+        }
+
+        r = write(out_fd, buf, l);
+        if (r < 0)
+                return -errno;
+
+        return (ssize_t) l;
+}
+
 int read_full_file(const char *fn, char **contents, size_t *size) {
         _cleanup_fclose_ FILE *f = NULL;
         size_t n, l;
@@ -168,7 +240,6 @@ int read_full_file(const char *fn, char **contents, size_t *size) {
 
         buf[l] = 0;
         *contents = buf;
-        buf = NULL;
 
         if (size)
                 *size = l;
diff --git a/src/shared/fileio.h b/src/shared/fileio.h
index 59e4150..06c2887 100644
--- a/src/shared/fileio.h
+++ b/src/shared/fileio.h
@@ -31,6 +31,7 @@ int write_string_file_atomic(const char *fn, const char *line);
 
 int read_one_line_file(const char *fn, char **line);
 int read_full_file(const char *fn, char **contents, size_t *size);
+ssize_t sendfile_full(int out_fd, const char *fn);
 
 int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
 int load_env_file(const char *fname, const char *separator, char ***l);
diff --git a/src/shared/util.c b/src/shared/util.c
index 206fc80..305a6c2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5791,6 +5791,8 @@ void* greedy_realloc(void **p, size_t *allocated, size_t need) {
         size_t a;
         void *q;
 
+        assert(allocated);
+
         if (*allocated >= need)
                 return *p;
 
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index e107213..f7b2fb4 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3675,6 +3675,107 @@ static int show_all(
         return 0;
 }
 
+static int cat(sd_bus *bus, char **args) {
+        int r = 0;
+        char **name;
+
+        _cleanup_free_ char *unit = NULL, *n = NULL;
+
+        assert(bus);
+        assert(args);
+
+        pager_open_if_enabled();
+
+        STRV_FOREACH(name, args+1) {
+                _cleanup_free_ char *fragment_path = NULL;
+                _cleanup_strv_free_ char **dropin_paths = NULL;
+                sd_bus_error error;
+                FILE *stdout;
+                char **path;
+
+                n = unit_name_mangle(*name);
+                if (!n)
+                        return log_oom();
+
+                unit = unit_dbus_path_from_name(n);
+                if (!unit)
+                        return log_oom();
+
+                if (need_daemon_reload(bus, n) > 0)
+                        log_warning("Unit file of %s changed on disk. Run 'systemctl%s daemon-reload'.",
+                                    n, arg_scope == UNIT_FILE_SYSTEM ? "" : " --user");
+
+                r = sd_bus_get_property_string(
+                                bus,
+                                "org.freedesktop.systemd1",
+                                unit,
+                                "org.freedesktop.systemd1.Unit",
+                                "FragmentPath",
+                                &error,
+                                &fragment_path);
+                if (r < 0) {
+                        log_warning("Failed to get FragmentPath: %s", bus_error_message(&error, r));
+                        continue;
+                }
+
+                if (isempty(fragment_path)) {
+                        free(fragment_path);
+                        fragment_path = NULL;
+
+                        if (sd_bus_get_property_string(
+                                        bus,
+                                        "org.freedesktop.systemd1",
+                                        unit,
+                                        "org.freedesktop.systemd1.Unit",
+                                        "SourcePath",
+                                        &error,
+                                        &fragment_path) < 0) {
+                                log_warning("Failed to get SourcePath: %s", bus_error_message(&error, r));
+                                continue;
+                        }
+                }
+
+                r = sd_bus_get_property_strv(
+                                bus,
+                                "org.freedesktop.systemd1",
+                                unit,
+                                "org.freedesktop.systemd1.Unit",
+                                "DropInPaths",
+                                &error,
+                                &dropin_paths);
+                if (r < 0) {
+                        log_warning("Failed to get DropInPaths: %s", bus_error_message(&error, r));
+                        continue;
+                }
+
+                stdout = fdopen(STDOUT_FILENO, "a");
+
+                if (!isempty(fragment_path)) {
+                        fprintf(stdout, "# %s\n", fragment_path);
+                        fflush(stdout);
+                        r = sendfile_full(STDOUT_FILENO, fragment_path);
+                        if (r < 0) {
+                                log_warning("Failed to cat %s: %s", fragment_path, strerror(-r));
+                                continue;
+                        }
+                }
+
+                STRV_FOREACH(path, dropin_paths) {
+                        fprintf(stdout,   "%s# %s\n",
+                                isempty(fragment_path) && path == dropin_paths ? "" : "\n",
+                                *path);
+                        fflush(stdout);
+                        r = sendfile_full(STDOUT_FILENO, *path);
+                        if (r < 0) {
+                                log_warning("Failed to cat %s: %s", *path, strerror(-r));
+                                continue;
+                        }
+                }
+        }
+
+        return r;
+}
+
 static int show(sd_bus *bus, char **args) {
         int r, ret = 0;
         bool show_properties, show_status, new_line = false;
@@ -4707,6 +4808,7 @@ static int systemctl_help(void) {
                "  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"
@@ -5690,6 +5792,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
                 { "check",                 MORE,  2, check_unit_active },
                 { "is-failed",             MORE,  2, check_unit_failed },
                 { "show",                  MORE,  1, show              },
+                { "cat",                   MORE,  2, cat               },
                 { "status",                MORE,  1, show              },
                 { "help",                  MORE,  2, show              },
                 { "snapshot",              LESS,  2, snapshot          },

commit f74294c1dabb41faaaa0e03777f0dd33b979eed6
Author: Shawn Landden <shawn at churchofgit.com>
Date:   Sat Nov 23 19:52:52 2013 -0800

    systemctl: refactor show()
    
    v2, don't leave in unused function

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 1d119c9..e107213 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3604,16 +3604,13 @@ static int show_one(
         return r;
 }
 
-static int show_one_by_pid(
-                const char *verb,
+static int get_unit_dbus_path_by_pid(
                 sd_bus *bus,
                 uint32_t pid,
-                bool *new_line,
-                bool *ellipsized) {
+                char **unit) {
 
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        const char *path = NULL;
         int r;
 
         r = sd_bus_call_method(
@@ -3630,11 +3627,11 @@ static int show_one_by_pid(
                 return r;
         }
 
-        r = sd_bus_message_read(reply, "o", &path);
+        r = sd_bus_message_read(reply, "o", unit);
         if (r < 0)
                 return bus_log_parse_error(r);
 
-        return show_one(verb, bus, path, false, new_line, ellipsized);
+        return 0;
 }
 
 static int show_all(
@@ -3702,41 +3699,34 @@ static int show(sd_bus *bus, char **args) {
                 ret = show_all(args[0], bus, false, &new_line, &ellipsized);
         else
                 STRV_FOREACH(name, args+1) {
+                        _cleanup_free_ char *unit = NULL;
                         uint32_t id;
 
                         if (safe_atou32(*name, &id) < 0) {
-                                _cleanup_free_ char *p = NULL, *n = NULL;
+                                _cleanup_free_ char *n = NULL;
                                 /* Interpret as unit name */
 
                                 n = unit_name_mangle(*name);
                                 if (!n)
                                         return log_oom();
 
-                                p = unit_dbus_path_from_name(n);
-                                if (!p)
+                                unit = unit_dbus_path_from_name(n);
+                                if (!unit)
                                         return log_oom();
 
-                                r = show_one(args[0], bus, p, show_properties, &new_line, &ellipsized);
-                                if (r != 0)
-                                        ret = r;
-
                         } else if (show_properties) {
-                                _cleanup_free_ char *p = NULL;
-
                                 /* Interpret as job id */
-                                if (asprintf(&p, "/org/freedesktop/systemd1/job/%u", id) < 0)
+                                if (asprintf(&unit, "/org/freedesktop/systemd1/job/%u", id) < 0)
                                         return log_oom();
 
-                                r = show_one(args[0], bus, p, show_properties, &new_line, &ellipsized);
-                                if (r != 0)
-                                        ret = r;
-
                         } else {
                                 /* Interpret as PID */
-                                r = show_one_by_pid(args[0], bus, id, &new_line, &ellipsized);
-                                if (r != 0)
+                                r = get_unit_dbus_path_by_pid(bus, id, &unit);
+                                if (r < 0)
                                         ret = r;
                         }
+
+                        show_one(args[0], bus, unit, show_properties, &new_line, &ellipsized);
                 }
 
         if (ellipsized && !arg_quiet)

commit 6a44e50f4c0938b0ba355fff21add6c067cd9837
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat Nov 30 21:23:01 2013 -0500

    man: explicitly say when multiple units can be specified
    
    itistoday> how do you specify multiple dependencies in a unit file? i've been
               googling and can't find this basic thing :-\
    itistoday> do you use a comma, or use multiple After= statements?

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 4dc427c..35dd4c7 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -410,10 +410,12 @@
                                 of the other units gets deactivated or
                                 its activation fails, this unit will
                                 be deactivated. This option may be
-                                specified more than once, in which
-                                case requirement dependencies for all
-                                listed names are created. Note that
-                                requirement dependencies do not
+                                specified more than once or multiple
+                                space-separated units may be specified
+                                in one option in which case
+                                requirement dependencies for all
+                                listed names will be created. Note
+                                that requirement dependencies do not
                                 influence the order in which services
                                 are started or stopped. This has to be
                                 configured independently with the
@@ -476,22 +478,23 @@
                                 <term><varname>RequisiteOverridable=</varname></term>
 
                                 <listitem><para>Similar to
-                                <varname>Requires=</varname>
-                                and <varname>RequiresOverridable=</varname>, respectively. However,
-                                if a unit listed here is not started
-                                already it will not be started and the
-                                transaction fails
-                                immediately.</para></listitem>
+                                <varname>Requires=</varname> and
+                                <varname>RequiresOverridable=</varname>,
+                                respectively. However, if the units
+                                listed here are not started already
+                                they will not be started and the
+                                transaction will fail immediately.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <term><varname>Wants=</varname></term>
 
                                 <listitem><para>A weaker version of
-                                <varname>Requires=</varname>. A unit
+                                <varname>Requires=</varname>. Units
                                 listed in this option will be started
                                 if the configuring unit is. However,
-                                if the listed unit fails to start up
+                                if the listed units fail to start
                                 or cannot be added to the transaction
                                 this has no impact on the validity of
                                 the transaction as a whole. This is
@@ -501,8 +504,8 @@
 
                                 <para>Note that dependencies of this
                                 type may also be configured outside of
-                                the unit configuration file by
-                                adding a symlink to a
+                                the unit configuration file by adding
+                                symlinks to a
                                 <filename>.wants/</filename> directory
                                 accompanying the unit file. For
                                 details see above.</para></listitem>
@@ -534,7 +537,7 @@
                                 of units. When systemd stops or restarts
                                 the units listed here, the action is
                                 propagated to this unit.
-                                Note that this is a one way dependency -
+                                Note that this is a one way dependency —
                                 changes to this unit do not affect the
                                 listed units.
                                 </para></listitem>
@@ -543,12 +546,12 @@
                         <varlistentry>
                                 <term><varname>Conflicts=</varname></term>
 
-                                <listitem><para>Configures negative
+                                <listitem><para>A space-separated list
+                                of unit names. Configures negative
                                 requirement dependencies. If a unit
-                                has a
-                                <varname>Conflicts=</varname> setting
-                                on another unit, starting the former
-                                will stop the latter and vice
+                                has a <varname>Conflicts=</varname>
+                                setting on another unit, starting the
+                                former will stop the latter and vice
                                 versa. Note that this setting is
                                 independent of and orthogonal to the
                                 <varname>After=</varname> and
@@ -575,7 +578,8 @@
                                 <term><varname>Before=</varname></term>
                                 <term><varname>After=</varname></term>
 
-                                <listitem><para>Configures ordering
+                                <listitem><para>A space-separated list
+                                of unit names. Configures ordering
                                 dependencies between units. If a unit
                                 <filename>foo.service</filename>
                                 contains a setting
@@ -624,18 +628,18 @@
                                 type <varname>After=</varname> or
                                 <varname>Before=</varname>. If two
                                 units have no ordering dependencies
-                                between them, they are shut down
-                                or started up simultaneously, and
-                                no ordering takes
+                                between them, they are shut down or
+                                started up simultaneously, and no
+                                ordering takes
                                 place. </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <term><varname>OnFailure=</varname></term>
 
-                                <listitem><para>Lists one or more
-                                units that are activated when this
-                                unit enters the
+                                <listitem><para>A space-separated list
+                                of one or more units that are
+                                activated when this unit enters the
                                 <literal>failed</literal>
                                 state.</para></listitem>
                         </varlistentry>
@@ -644,16 +648,17 @@
                                 <term><varname>PropagatesReloadTo=</varname></term>
                                 <term><varname>ReloadPropagatedFrom=</varname></term>
 
-                                <listitem><para>Lists one or more
-                                units where reload requests on the
-                                unit will be propagated to/on the
-                                other unit will be propagated
-                                from. Issuing a reload request on a
-                                unit will automatically also enqueue a
-                                reload request on all units that the
-                                reload request shall be propagated to
-                                via these two
-                                settings.</para></listitem>
+                                <listitem><para>A space-separated list
+                                of one or more units where reload
+                                requests on this unit will be
+                                propagated to, or reload requests on
+                                the other unit will be propagated to
+                                this unit, respectively. Issuing a
+                                reload request on a unit will
+                                automatically also enqueue a reload
+                                request on all units that the reload
+                                request shall be propagated to via
+                                these two settings.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
@@ -1130,32 +1135,34 @@
                         <varlistentry>
                                 <term><varname>Alias=</varname></term>
 
-                                <listitem><para>Additional names this
-                                unit shall be installed under. The
-                                names listed here must have the same
-                                suffix (i.e. type) as the unit file
-                                name. This option may be specified
-                                more than once, in which case all
-                                listed names are used. At installation
-                                time,
-                                <command>systemctl enable</command>
-                                will create symlinks from these names
-                                to the unit filename.</para></listitem>
+                                <listitem><para>A space-seperated list
+                                of additional names this unit shall be
+                                installed under. The names listed here
+                                must have the same suffix (i.e. type)
+                                as the unit file name. This option may
+                                be specified more than once, in which
+                                case all listed names are used. At
+                                installation time, <command>systemctl
+                                enable</command> will create symlinks
+                                from these names to the unit
+                                filename.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <term><varname>WantedBy=</varname></term>
                                 <term><varname>RequiredBy=</varname></term>
 
-                                <listitem><para>A symbolic link is
-                                created in the
-                                <filename>.wants/</filename> or
-                                <filename>.requires/</filename> directory
-                                of the listed unit when this unit is
-                                activated by <command>systemctl
-                                enable</command>.  This has the effect
-                                that a dependency of type
-                                <varname>Wants=</varname> or
+                                <listitem><para>This option may be
+                                used more than once, or a
+                                space-separated list of unit names may
+                                be given. A symbolic link is created
+                                in the <filename>.wants/</filename> or
+                                <filename>.requires/</filename>
+                                directory of each of the listed units
+                                when this unit is installed by
+                                <command>systemctl enable</command>.
+                                This has the effect that a dependency
+                                of type <varname>Wants=</varname> or
                                 <varname>Requires=</varname> is added
                                 from the listed unit to the current
                                 unit. The primary result is that the
@@ -1201,7 +1208,12 @@
                                 and <command>systemctl
                                 disable</command> will automatically
                                 install/uninstall units listed in this option as
-                                well.</para></listitem>
+                                well.</para>
+
+                                <para>This option may be used more
+                                than once, or a space-separated list
+                                of unit names may be
+                                given.</para></listitem>
                         </varlistentry>
                 </variablelist>
 



More information about the systemd-commits mailing list