chiark / gitweb /
unit: rename BindTo= to BindsTo=
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Jul 2012 21:34:40 +0000 (23:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Jul 2012 21:34:40 +0000 (23:34 +0200)
all other dependencies are in 3rd person. Change BindTo= accordingly to
BindsTo=.

Of course, the dependency is widely used, hence we parse the old name
too for compatibility.

15 files changed:
TODO
man/systemd.unit.xml
src/core/dbus-unit.c
src/core/dbus-unit.h
src/core/load-fragment-gperf.gperf.m4
src/core/service.c
src/core/target.c
src/core/transaction.c
src/core/unit.c
src/core/unit.h
src/cryptsetup/cryptsetup-generator.c
units/hibernate.target
units/serial-getty@.service.m4
units/suspend.target
units/systemd-fsck@.service.in

diff --git a/TODO b/TODO
index 3bf6ef8..61c0b57 100644 (file)
--- a/TODO
+++ b/TODO
@@ -40,12 +40,8 @@ Features:
 
 * seccomp filters for services
 
-* replace BindTo= by BindsTo=, but keep old name for compat
-
 * switch-root: sockets need relabelling
 
-* switch-root: handle journald restart
-
 * segfault in journalctl during /var migration
 
 * systemd-analyze post-boot is broken for initrd
index 93fb37b..3fd76f3 100644 (file)
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>BindTo=</varname></term>
+                                <term><varname>BindsTo=</varname></term>
 
                                 <listitem><para>Configures requirement
                                 dependencies, very similar in style to
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>PropagateReloadTo=</varname></term>
-                                <term><varname>PropagateReloadFrom=</varname></term>
+                                <term><varname>PropagatesReloadTo=</varname></term>
+                                <term><varname>ReloadPropagatedFrom=</varname></term>
 
                                 <listitem><para>Lists one or more
                                 units where reload requests on the
index f85f3f8..2114587 100644 (file)
@@ -793,7 +793,7 @@ const BusProperty bus_unit_properties[] = {
         { "Requisite",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE]),               true },
         { "RequisiteOverridable", bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUISITE_OVERRIDABLE]),   true },
         { "Wants",                bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTS]),                   true },
-        { "BindTo",               bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BIND_TO]),                 true },
+        { "BindsTo",              bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_BINDS_TO]),                true },
         { "RequiredBy",           bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY]),             true },
         { "RequiredByOverridable",bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY_OVERRIDABLE]), true },
         { "WantedBy",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_WANTED_BY]),               true },
@@ -805,8 +805,8 @@ const BusProperty bus_unit_properties[] = {
         { "OnFailure",            bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_ON_FAILURE]),              true },
         { "Triggers",             bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERS]),                true },
         { "TriggeredBy",          bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]),            true },
-        { "PropagateReloadTo",    bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_TO]),     true },
-        { "PropagateReloadFrom",  bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_FROM]),   true },
+        { "PropagatesReloadTo",   bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_PROPAGATES_RELOAD_TO]),    true },
+        { "ReloadPropagatedFrom", bus_unit_append_dependencies,      "as", offsetof(Unit, dependencies[UNIT_RELOAD_PROPAGATED_FROM]),  true },
         { "RequiresMountsFor",    bus_property_append_strv,          "as", offsetof(Unit, requires_mounts_for),                        true },
         { "Documentation",        bus_property_append_strv,          "as", offsetof(Unit, documentation),                              true },
         { "Description",          bus_unit_append_description,        "s", 0 },
index ae94ca2..d5902ee 100644 (file)
@@ -71,7 +71,7 @@
         "  <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"RequisiteOverridable\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"Wants\" type=\"as\" access=\"read\"/>\n"    \
-        "  <property name=\"BindTo\" type=\"as\" access=\"read\"/>\n"    \
+        "  <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n"    \
         "  <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"RequiredByOverridable\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \
@@ -83,8 +83,8 @@
         "  <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n"    \
         "  <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n"    \
         "  <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n"    \
-        "  <property name=\"PropagateReloadTo\" type=\"as\" access=\"read\"/>\n" \
-        "  <property name=\"PropagateReloadFrom\" type=\"as\" access=\"read\"/>\n" \
+        "  <property name=\"PropagatesReloadTo\" type=\"as\" access=\"read\"/>\n" \
+        "  <property name=\"ReloadPropagatedFrom\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"RequiresMountsFor\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"SourcePath\" type=\"s\" access=\"read\"/>\n" \
index f5e9b70..192c2b2 100644 (file)
@@ -98,13 +98,16 @@ Unit.RequiresOverridable,        config_parse_unit_deps,             UNIT_REQUIR
 Unit.Requisite,                  config_parse_unit_deps,             UNIT_REQUISITE,                0
 Unit.RequisiteOverridable,       config_parse_unit_deps,             UNIT_REQUISITE_OVERRIDABLE,    0
 Unit.Wants,                      config_parse_unit_deps,             UNIT_WANTS,                    0
-Unit.BindTo,                     config_parse_unit_deps,             UNIT_BIND_TO,                  0
+Unit.BindsTo,                    config_parse_unit_deps,             UNIT_BINDS_TO,                 0
+Unit.BindTo,                     config_parse_unit_deps,             UNIT_BINDS_TO,                 0
 Unit.Conflicts,                  config_parse_unit_deps,             UNIT_CONFLICTS,                0
 Unit.Before,                     config_parse_unit_deps,             UNIT_BEFORE,                   0
 Unit.After,                      config_parse_unit_deps,             UNIT_AFTER,                    0
 Unit.OnFailure,                  config_parse_unit_deps,             UNIT_ON_FAILURE,               0
-Unit.PropagateReloadTo,          config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_TO,      0
-Unit.PropagateReloadFrom,        config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_FROM,    0
+Unit.PropagatesReloadTo,         config_parse_unit_deps,             UNIT_PROPAGATES_RELOAD_TO,     0
+Unit.PropagateReloadTo,          config_parse_unit_deps,             UNIT_PROPAGATES_RELOAD_TO,     0
+Unit.ReloadPropagatedFrom,       config_parse_unit_deps,             UNIT_RELOAD_PROPAGATED_FROM,   0
+Unit.PropagateReloadFrom,        config_parse_unit_deps,             UNIT_RELOAD_PROPAGATED_FROM,   0
 Unit.RequiresMountsFor,          config_parse_unit_requires_mounts_for, 0,                          offsetof(Unit, requires_mounts_for)
 Unit.StopWhenUnneeded,           config_parse_bool,                  0,                             offsetof(Unit, stop_when_unneeded)
 Unit.RefuseManualStart,          config_parse_bool,                  0,                             offsetof(Unit, refuse_manual_start)
index 2be6ee5..0a66588 100644 (file)
@@ -2464,7 +2464,7 @@ static int service_start(Unit *u) {
                 return 0;
 
         /* A service that will be restarted must be stopped first to
-         * trigger BindTo and/or OnFailure dependencies. If a user
+         * trigger BindsTo and/or OnFailure dependencies. If a user
          * does not want to wait for the holdoff time to elapse, the
          * service should be manually restarted, not started. */
         if (s->state == SERVICE_AUTO_RESTART) {
index 092b206..55f9fc6 100644 (file)
@@ -59,7 +59,7 @@ static int target_add_default_dependencies(Target *t) {
                 UNIT_REQUISITE,
                 UNIT_REQUISITE_OVERRIDABLE,
                 UNIT_WANTS,
-                UNIT_BIND_TO
+                UNIT_BINDS_TO
         };
 
         Iterator i;
index 44fdc06..a1cf706 100644 (file)
@@ -893,7 +893,7 @@ int transaction_add_job_and_dependencies(
                                 }
                         }
 
-                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_BIND_TO], i) {
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_BINDS_TO], i) {
                                 r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, override, false, false, ignore_order, e);
                                 if (r < 0) {
                                         if (r != -EBADR)
@@ -998,7 +998,7 @@ int transaction_add_job_and_dependencies(
 
                 if (type == JOB_RELOAD) {
 
-                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATES_RELOAD_TO], i) {
                                 r = transaction_add_job_and_dependencies(tr, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e);
                                 if (r < 0) {
                                         log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
index 516f4fa..6914ccd 100644 (file)
@@ -1144,7 +1144,7 @@ static void retroactively_start_dependencies(Unit *u) {
                     !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
                         manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
 
-        SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
+        SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
                 if (!set_get(u->dependencies[UNIT_AFTER], other) &&
                     !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
                         manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
@@ -1209,7 +1209,7 @@ static void check_unneeded_dependencies(Unit *u) {
         SET_FOREACH(other, u->dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
                 if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
                         unit_check_unneeded(other);
-        SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
+        SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
                 if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
                         unit_check_unneeded(other);
 }
@@ -1595,11 +1595,11 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
                 [UNIT_WANTS] = UNIT_WANTED_BY,
                 [UNIT_REQUISITE] = UNIT_REQUIRED_BY,
                 [UNIT_REQUISITE_OVERRIDABLE] = UNIT_REQUIRED_BY_OVERRIDABLE,
-                [UNIT_BIND_TO] = UNIT_BOUND_BY,
+                [UNIT_BINDS_TO] = UNIT_BOUND_BY,
                 [UNIT_REQUIRED_BY] = _UNIT_DEPENDENCY_INVALID,
                 [UNIT_REQUIRED_BY_OVERRIDABLE] = _UNIT_DEPENDENCY_INVALID,
                 [UNIT_WANTED_BY] = _UNIT_DEPENDENCY_INVALID,
-                [UNIT_BOUND_BY] = UNIT_BIND_TO,
+                [UNIT_BOUND_BY] = UNIT_BINDS_TO,
                 [UNIT_CONFLICTS] = UNIT_CONFLICTED_BY,
                 [UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
                 [UNIT_BEFORE] = UNIT_AFTER,
@@ -1609,8 +1609,8 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
                 [UNIT_REFERENCED_BY] = UNIT_REFERENCES,
                 [UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
                 [UNIT_TRIGGERED_BY] = UNIT_TRIGGERS,
-                [UNIT_PROPAGATE_RELOAD_TO] = UNIT_PROPAGATE_RELOAD_FROM,
-                [UNIT_PROPAGATE_RELOAD_FROM] = UNIT_PROPAGATE_RELOAD_TO
+                [UNIT_PROPAGATES_RELOAD_TO] = UNIT_RELOAD_PROPAGATED_FROM,
+                [UNIT_RELOAD_PROPAGATED_FROM] = UNIT_PROPAGATES_RELOAD_TO
         };
         int r, q = 0, v = 0, w = 0;
 
@@ -2519,7 +2519,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
         if (r < 0)
                 return r;
 
-        if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BIND_TO, device, true)) < 0)
+        if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
                 return r;
 
         if (wants)
@@ -2765,7 +2765,7 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
         [UNIT_REQUISITE_OVERRIDABLE] = "RequisiteOverridable",
         [UNIT_REQUIRED_BY] = "RequiredBy",
         [UNIT_REQUIRED_BY_OVERRIDABLE] = "RequiredByOverridable",
-        [UNIT_BIND_TO] = "BindTo",
+        [UNIT_BINDS_TO] = "BindsTo",
         [UNIT_WANTED_BY] = "WantedBy",
         [UNIT_CONFLICTS] = "Conflicts",
         [UNIT_CONFLICTED_BY] = "ConflictedBy",
@@ -2777,8 +2777,8 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
         [UNIT_ON_FAILURE] = "OnFailure",
         [UNIT_TRIGGERS] = "Triggers",
         [UNIT_TRIGGERED_BY] = "TriggeredBy",
-        [UNIT_PROPAGATE_RELOAD_TO] = "PropagateReloadTo",
-        [UNIT_PROPAGATE_RELOAD_FROM] = "PropagateReloadFrom"
+        [UNIT_PROPAGATES_RELOAD_TO] = "PropagatesReloadTo",
+        [UNIT_RELOAD_PROPAGATED_FROM] = "ReloadPropagatedFrom"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);
index 0e1e72e..9d75e02 100644 (file)
@@ -76,13 +76,13 @@ enum UnitDependency {
         UNIT_REQUISITE,
         UNIT_REQUISITE_OVERRIDABLE,
         UNIT_WANTS,
-        UNIT_BIND_TO,
+        UNIT_BINDS_TO,
 
         /* Inverse of the above */
         UNIT_REQUIRED_BY,             /* inverse of 'requires' and 'requisite' is 'required_by' */
         UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */
         UNIT_WANTED_BY,               /* inverse of 'wants' */
-        UNIT_BOUND_BY,                /* inverse of 'bind_to' */
+        UNIT_BOUND_BY,                /* inverse of 'binds_to' */
 
         /* Negative dependencies */
         UNIT_CONFLICTS,               /* inverse of 'conflicts' is 'conflicted_by' */
@@ -100,8 +100,8 @@ enum UnitDependency {
         UNIT_TRIGGERED_BY,
 
         /* Propagate reloads */
-        UNIT_PROPAGATE_RELOAD_TO,
-        UNIT_PROPAGATE_RELOAD_FROM,
+        UNIT_PROPAGATES_RELOAD_TO,
+        UNIT_RELOAD_PROPAGATED_FROM,
 
         /* Reference information for GC logic */
         UNIT_REFERENCES,              /* Inverse of 'references' is 'referenced_by' */
index 7801de6..d098424 100644 (file)
@@ -124,7 +124,7 @@ static int create_disk(
                 "SourcePath=/etc/crypttab\n"
                 "Conflicts=umount.target\n"
                 "DefaultDependencies=no\n"
-                "BindTo=%s dev-mapper-%%i.device\n"
+                "BindsTo=%s dev-mapper-%%i.device\n"
                 "After=systemd-readahead-collect.service systemd-readahead-replay.service %s\n"
                 "Before=umount.target\n",
                 d, d);
index c564602..143eb59 100644 (file)
@@ -9,5 +9,5 @@
 Description=Hibernate
 Documentation=man:systemd.special(7)
 DefaultDependencies=no
-BindTo=systemd-hibernate.service
+BindsTo=systemd-hibernate.service
 After=systemd-hibernate.service
index fa386ea..d6a7669 100644 (file)
@@ -8,7 +8,7 @@
 [Unit]
 Description=Serial Getty on %I
 Documentation=man:agetty(8) man:systemd-getty-generator(8)
-BindTo=dev-%i.device
+BindsTo=dev-%i.device
 After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
 m4_ifdef(`TARGET_FEDORA',
 After=rc-local.service
index 83f69f1..f50cb22 100644 (file)
@@ -9,5 +9,5 @@
 Description=Suspend
 Documentation=man:systemd.special(7)
 DefaultDependencies=no
-BindTo=systemd-suspend.service
+BindsTo=systemd-suspend.service
 After=systemd-suspend.service
index 1cade4e..b3c71eb 100644 (file)
@@ -9,7 +9,7 @@
 Description=File System Check on %f
 Documentation=man:systemd-fsck@.service(8)
 DefaultDependencies=no
-BindTo=%i.device
+BindsTo=%i.device
 After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
 Before=shutdown.target