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 3bf6ef8dffa361655589dfef118677bea9dc4cde..61c0b57126eb087fb605f96fbc916d35c95297a7 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 93fb37b72b3f674eab50da7a09eece7ec1cb977e..3fd76f3020b0e0a85a12df0ab89ed41df6d9d5ed 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 f85f3f898a728847094bce371b04d56d9d04568b..21145873ea4503c0a9fd50c13a236b54e956f8c8 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 ae94ca2c2bc07d0da203ff1f6985e52b71c65fb9..d5902ee22a4c10a716bc264dae5243e74bd6fab3 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 f5e9b70672f1201e0fda8d4facd2f635b686ea98..192c2b278073ec23323d7a6a91c11ef6cdcf5174 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 2be6ee5d99a992459cfdc0478d5add4c73928fb7..0a6658809e8b612ab468c48566fd9ecf5f24665e 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 092b2065f2082f914f5971a4502354a6698c5fef..55f9fc6fc4b72db03084795f79ee9d647d869752 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 44fdc06580a9823a6674b2d95267f38a1a6c0c1b..a1cf70693428d9ad535d77a883692422a40afca1 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 516f4fad8bb980d18cbed062a487e71d5684acc3..6914ccdb99f0aeb0861e115855a5f0cf5b13feb7 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 0e1e72ebf0b3a766a8206ae31d123098b16f15c7..9d75e02532a40776b8b0374e2a551edf398855ee 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 7801de64b52ba929d433d367a28f03eeff5259d0..d0984242c803c53b52670014c5ae04799a6b7862 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 c56460237da0ce940853db2b7be4eb0010f2d01c..143eb59230c78167bd6830dfc2927a11017671c4 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 fa386ea0d453b81ef4f2bffb37b7f9341f7bf81d..d6a7669045498896a648cd0cbd252cd74a486f58 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 83f69f1b545c6480efb91eb119e458018ee92866..f50cb2264f5d9af3127e2ec802cb3c004658654c 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 1cade4e6023daf456f3015cf7518b1784aae4d09..b3c71eb25013ce0f4c8ec5df6da1de8837958fec 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