[systemd-commits] 2 commits - TODO man/systemd.unit.xml src/core

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jun 22 07:27:21 PDT 2012


 TODO                                  |    4 ++
 man/systemd.unit.xml                  |   54 ----------------------------------
 src/core/dbus-manager.c               |   13 --------
 src/core/load-fragment-gperf.gperf.m4 |    1 
 src/core/load-fragment.c              |   44 ---------------------------
 src/core/load-fragment.h              |    1 
 6 files changed, 5 insertions(+), 112 deletions(-)

New commits:
commit 8ff290af3b7db00eef76bdec61fee4aca7d84d0b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 22 16:24:57 2012 +0200

    unit: drop the Names= option
    
    Names= is a source of errors, simply because alias names specified like
    this only become relevant after a unit has been loaded but cannot be
    used to load a unit.
    
    Let's get rid of the confusion and drop this field. To establish alias
    names peope should use symlinks, which have the the benefit of being
    useful as key to load a unit, even though they are not taken into
    account if unit names are listed but they haven't been explicitly
    referenced before.

diff --git a/TODO b/TODO
index 7fb3747..8778707 100644
--- a/TODO
+++ b/TODO
@@ -399,5 +399,3 @@ Regularly:
 Scheduled for removal (or fixing):
 
 * xxxOverridable dependencies
-
-* Names= unit option
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 123965b..93fb37b 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -870,35 +870,6 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>Names=</varname></term>
-
-                                <listitem><para>Additional names for
-                                this unit. 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. Note
-                                that this option is different from the
-                                <varname>Alias=</varname> option from
-                                the [Install] section mentioned
-                                below. See below for details. Note
-                                that in almost all cases this option
-                                is not what you want. A symlink alias
-                                in the file system is generally
-                                preferable since it can be used as
-                                lookup key. If a unit with a symlinked
-                                alias name is not loaded and needs to
-                                be it is easily found via the
-                                symlink. However, if a unit with an
-                                alias name configured with this
-                                setting is not loaded it will not be
-                                discovered. This settings' only use is
-                                in conjunction with service
-                                instances.</para>
-                                </listitem>
-                        </varlistentry>
-
-                        <varlistentry>
                                 <term><varname>SourcePath=</varname></term>
                                 <listitem><para>A path to a
                                 configuration file this unit has been
@@ -936,30 +907,7 @@
                                 time,
                                 <command>systemctl enable</command>
                                 will create symlinks from these names
-                                to the unit file name. Note that this
-                                is different from the
-                                <varname>Names=</varname> option from
-                                the [Unit] section mentioned above:
-                                The names from
-                                <varname>Names=</varname> apply
-                                unconditionally if the unit is
-                                loaded. The names from
-                                <varname>Alias=</varname> apply only
-                                if the unit has actually been
-                                installed with the
-                                <command>systemctl enable</command>
-                                command.  Also, if systemd searches for a
-                                unit, it will discover symlinked alias
-                                names as configured with
-                                <varname>Alias=</varname>, but not
-                                names configured with
-                                <varname>Names=</varname> only. It is
-                                a common pattern to list a name in
-                                both options. In this case, a unit
-                                will be active under all names if
-                                installed, but also if not installed
-                                but requested explicitly under its
-                                main name.</para></listitem>
+                                to the unit file name.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index d51c7ac..f5e9b70 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -90,7 +90,6 @@ $1.UtmpIdentifier,               config_parse_unit_string_printf,    0,
 $1.ControlGroupModify,           config_parse_bool,                  0,                             offsetof($1, exec_context.control_group_modify)
 $1.ControlGroupPersistent,       config_parse_tristate,              0,                             offsetof($1, exec_context.control_group_persistent)'
 )m4_dnl
-Unit.Names,                      config_parse_unit_names,            0,                             0
 Unit.Description,                config_parse_unit_string_printf,    0,                             offsetof(Unit, description)
 Unit.Documentation,              config_parse_documentation,         0,                             offsetof(Unit, documentation)
 Unit.SourcePath,                 config_parse_path,                  0,                             offsetof(Unit, source_path)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 22da6c1..1ca0dec 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -105,49 +105,6 @@ int config_parse_unit_deps(
         return 0;
 }
 
-int config_parse_unit_names(
-                const char *filename,
-                unsigned line,
-                const char *section,
-                const char *lvalue,
-                int ltype,
-                const char *rvalue,
-                void *data,
-                void *userdata) {
-
-        Unit *u = userdata;
-        char *w;
-        size_t l;
-        char *state;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char *t, *k;
-                int r;
-
-                t = strndup(w, l);
-                if (!t)
-                        return -ENOMEM;
-
-                k = unit_name_printf(u, t);
-                free(t);
-                if (!k)
-                        return -ENOMEM;
-
-                r = unit_merge_by_name(u, k);
-                if (r < 0)
-                        log_error("Failed to add name %s, ignoring: %s", k, strerror(-r));
-
-                free(k);
-        }
-
-        return 0;
-}
-
 int config_parse_unit_string_printf(
                 const char *filename,
                 unsigned line,
@@ -2395,7 +2352,6 @@ void unit_dump_config_items(FILE *f) {
                 { config_parse_limit,                 "LIMIT" },
                 { config_parse_unit_cgroup,           "CGROUP [...]" },
                 { config_parse_unit_deps,             "UNIT [...]" },
-                { config_parse_unit_names,            "UNIT [...]" },
                 { config_parse_exec,                  "PATH [ARGUMENT [...]]" },
                 { config_parse_service_type,          "SERVICETYPE" },
                 { config_parse_service_restart,       "SERVICERESTART" },
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index 9a3465a..501ea4a 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -32,7 +32,6 @@ void unit_dump_config_items(FILE *f);
 
 int config_parse_warn_compat(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_deps(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_unit_names(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_string_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_strv_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_path_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);

commit a3a3e5b6ae7836152052d77a9e6032a9e84e2039
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 22 16:18:47 2012 +0200

    dbus: don't expose SysVInitPath and SysVRcndPath on the bus
    
    People should use systemd.pc if anything at all to determine these
    directories, and people should not assume that the bus fields are part
    of the supported API, so let's just drop this.

diff --git a/TODO b/TODO
index 7785e32..7fb3747 100644
--- a/TODO
+++ b/TODO
@@ -395,3 +395,9 @@ Regularly:
 * pahole
 
 * set_put(), hashmap_put() return values check. i.e. == 0 doesn't free()!
+
+Scheduled for removal (or fixing):
+
+* xxxOverridable dependencies
+
+* Names= unit option
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index f57c1ee..d3b26b7 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -250,14 +250,6 @@
         "  <property name=\"ShutdownWatchdogUSec\" type=\"s\" access=\"readwrite\"/>\n" \
         "  <property name=\"HaveWatchdog\" type=\"b\" access=\"read\"/>\n"
 
-#ifdef HAVE_SYSV_COMPAT
-#define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV                           \
-        "  <property name=\"SysVInitPath\" type=\"as\" access=\"read\"/>\n" \
-        "  <property name=\"SysVRcndPath\" type=\"as\" access=\"read\"/>\n"
-#else
-#define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV
-#endif
-
 #define BUS_MANAGER_INTERFACE_END                                       \
         " </interface>\n"
 
@@ -266,7 +258,6 @@
         BUS_MANAGER_INTERFACE_METHODS                                   \
         BUS_MANAGER_INTERFACE_SIGNALS                                   \
         BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL                        \
-        BUS_MANAGER_INTERFACE_PROPERTIES_SYSV                           \
         BUS_MANAGER_INTERFACE_END
 
 #define INTROSPECTION_BEGIN                                             \
@@ -567,10 +558,6 @@ static const BusProperty bus_manager_properties[] = {
         { "RuntimeWatchdogUSec", bus_property_append_usec,         "t", offsetof(Manager, runtime_watchdog),           false, bus_manager_set_runtime_watchdog_usec },
         { "ShutdownWatchdogUSec", bus_property_append_usec,        "t", offsetof(Manager, shutdown_watchdog),          false, bus_property_set_usec },
         { "HaveWatchdog",  bus_manager_append_have_watchdog,       "b", 0                                              },
-#ifdef HAVE_SYSV_COMPAT
-        { "SysVInitPath",  bus_property_append_strv,              "as", offsetof(Manager, lookup_paths.sysvinit_path), true },
-        { "SysVRcndPath",  bus_property_append_strv,              "as", offsetof(Manager, lookup_paths.sysvrcnd_path), true },
-#endif
         { NULL, }
 };
 



More information about the systemd-commits mailing list