Skip to content

Commit 7f2cdda

Browse files
committed
unit: rename BindTo= to BindsTo=
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.
1 parent 976c46f commit 7f2cdda

15 files changed

+38
-39
lines changed

TODO

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ Features:
4040

4141
* seccomp filters for services
4242

43-
* replace BindTo= by BindsTo=, but keep old name for compat
44-
4543
* switch-root: sockets need relabelling
4644

47-
* switch-root: handle journald restart
48-
4945
* segfault in journalctl during /var migration
5046

5147
* systemd-analyze post-boot is broken for initrd

man/systemd.unit.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
</varlistentry>
411411

412412
<varlistentry>
413-
<term><varname>BindTo=</varname></term>
413+
<term><varname>BindsTo=</varname></term>
414414

415415
<listitem><para>Configures requirement
416416
dependencies, very similar in style to
@@ -527,8 +527,8 @@
527527
</varlistentry>
528528

529529
<varlistentry>
530-
<term><varname>PropagateReloadTo=</varname></term>
531-
<term><varname>PropagateReloadFrom=</varname></term>
530+
<term><varname>PropagatesReloadTo=</varname></term>
531+
<term><varname>ReloadPropagatedFrom=</varname></term>
532532

533533
<listitem><para>Lists one or more
534534
units where reload requests on the

src/core/dbus-unit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ const BusProperty bus_unit_properties[] = {
793793
{ "Requisite", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUISITE]), true },
794794
{ "RequisiteOverridable", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUISITE_OVERRIDABLE]), true },
795795
{ "Wants", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_WANTS]), true },
796-
{ "BindTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_BIND_TO]), true },
796+
{ "BindsTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_BINDS_TO]), true },
797797
{ "RequiredBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY]), true },
798798
{ "RequiredByOverridable",bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY_OVERRIDABLE]), true },
799799
{ "WantedBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_WANTED_BY]), true },
@@ -805,8 +805,8 @@ const BusProperty bus_unit_properties[] = {
805805
{ "OnFailure", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_ON_FAILURE]), true },
806806
{ "Triggers", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_TRIGGERS]), true },
807807
{ "TriggeredBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]), true },
808-
{ "PropagateReloadTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_TO]), true },
809-
{ "PropagateReloadFrom", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_FROM]), true },
808+
{ "PropagatesReloadTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATES_RELOAD_TO]), true },
809+
{ "ReloadPropagatedFrom", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_RELOAD_PROPAGATED_FROM]), true },
810810
{ "RequiresMountsFor", bus_property_append_strv, "as", offsetof(Unit, requires_mounts_for), true },
811811
{ "Documentation", bus_property_append_strv, "as", offsetof(Unit, documentation), true },
812812
{ "Description", bus_unit_append_description, "s", 0 },

src/core/dbus-unit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
" <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \
7272
" <property name=\"RequisiteOverridable\" type=\"as\" access=\"read\"/>\n" \
7373
" <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \
74-
" <property name=\"BindTo\" type=\"as\" access=\"read\"/>\n" \
74+
" <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \
7575
" <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \
7676
" <property name=\"RequiredByOverridable\" type=\"as\" access=\"read\"/>\n" \
7777
" <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \
@@ -83,8 +83,8 @@
8383
" <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n" \
8484
" <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n" \
8585
" <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n" \
86-
" <property name=\"PropagateReloadTo\" type=\"as\" access=\"read\"/>\n" \
87-
" <property name=\"PropagateReloadFrom\" type=\"as\" access=\"read\"/>\n" \
86+
" <property name=\"PropagatesReloadTo\" type=\"as\" access=\"read\"/>\n" \
87+
" <property name=\"ReloadPropagatedFrom\" type=\"as\" access=\"read\"/>\n" \
8888
" <property name=\"RequiresMountsFor\" type=\"as\" access=\"read\"/>\n" \
8989
" <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \
9090
" <property name=\"SourcePath\" type=\"s\" access=\"read\"/>\n" \

src/core/load-fragment-gperf.gperf.m4

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ Unit.RequiresOverridable, config_parse_unit_deps, UNIT_REQUIR
9898
Unit.Requisite, config_parse_unit_deps, UNIT_REQUISITE, 0
9999
Unit.RequisiteOverridable, config_parse_unit_deps, UNIT_REQUISITE_OVERRIDABLE, 0
100100
Unit.Wants, config_parse_unit_deps, UNIT_WANTS, 0
101-
Unit.BindTo, config_parse_unit_deps, UNIT_BIND_TO, 0
101+
Unit.BindsTo, config_parse_unit_deps, UNIT_BINDS_TO, 0
102+
Unit.BindTo, config_parse_unit_deps, UNIT_BINDS_TO, 0
102103
Unit.Conflicts, config_parse_unit_deps, UNIT_CONFLICTS, 0
103104
Unit.Before, config_parse_unit_deps, UNIT_BEFORE, 0
104105
Unit.After, config_parse_unit_deps, UNIT_AFTER, 0
105106
Unit.OnFailure, config_parse_unit_deps, UNIT_ON_FAILURE, 0
106-
Unit.PropagateReloadTo, config_parse_unit_deps, UNIT_PROPAGATE_RELOAD_TO, 0
107-
Unit.PropagateReloadFrom, config_parse_unit_deps, UNIT_PROPAGATE_RELOAD_FROM, 0
107+
Unit.PropagatesReloadTo, config_parse_unit_deps, UNIT_PROPAGATES_RELOAD_TO, 0
108+
Unit.PropagateReloadTo, config_parse_unit_deps, UNIT_PROPAGATES_RELOAD_TO, 0
109+
Unit.ReloadPropagatedFrom, config_parse_unit_deps, UNIT_RELOAD_PROPAGATED_FROM, 0
110+
Unit.PropagateReloadFrom, config_parse_unit_deps, UNIT_RELOAD_PROPAGATED_FROM, 0
108111
Unit.RequiresMountsFor, config_parse_unit_requires_mounts_for, 0, offsetof(Unit, requires_mounts_for)
109112
Unit.StopWhenUnneeded, config_parse_bool, 0, offsetof(Unit, stop_when_unneeded)
110113
Unit.RefuseManualStart, config_parse_bool, 0, offsetof(Unit, refuse_manual_start)

src/core/service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ static int service_start(Unit *u) {
24642464
return 0;
24652465

24662466
/* A service that will be restarted must be stopped first to
2467-
* trigger BindTo and/or OnFailure dependencies. If a user
2467+
* trigger BindsTo and/or OnFailure dependencies. If a user
24682468
* does not want to wait for the holdoff time to elapse, the
24692469
* service should be manually restarted, not started. */
24702470
if (s->state == SERVICE_AUTO_RESTART) {

src/core/target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int target_add_default_dependencies(Target *t) {
5959
UNIT_REQUISITE,
6060
UNIT_REQUISITE_OVERRIDABLE,
6161
UNIT_WANTS,
62-
UNIT_BIND_TO
62+
UNIT_BINDS_TO
6363
};
6464

6565
Iterator i;

src/core/transaction.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ int transaction_add_job_and_dependencies(
893893
}
894894
}
895895

896-
SET_FOREACH(dep, ret->unit->dependencies[UNIT_BIND_TO], i) {
896+
SET_FOREACH(dep, ret->unit->dependencies[UNIT_BINDS_TO], i) {
897897
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, override, false, false, ignore_order, e);
898898
if (r < 0) {
899899
if (r != -EBADR)
@@ -998,7 +998,7 @@ int transaction_add_job_and_dependencies(
998998

999999
if (type == JOB_RELOAD) {
10001000

1001-
SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
1001+
SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATES_RELOAD_TO], i) {
10021002
r = transaction_add_job_and_dependencies(tr, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e);
10031003
if (r < 0) {
10041004
log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->id, bus_error(e, r));

src/core/unit.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ static void retroactively_start_dependencies(Unit *u) {
11441144
!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
11451145
manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
11461146

1147-
SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
1147+
SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
11481148
if (!set_get(u->dependencies[UNIT_AFTER], other) &&
11491149
!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
11501150
manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
@@ -1209,7 +1209,7 @@ static void check_unneeded_dependencies(Unit *u) {
12091209
SET_FOREACH(other, u->dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
12101210
if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
12111211
unit_check_unneeded(other);
1212-
SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
1212+
SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
12131213
if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
12141214
unit_check_unneeded(other);
12151215
}
@@ -1595,11 +1595,11 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
15951595
[UNIT_WANTS] = UNIT_WANTED_BY,
15961596
[UNIT_REQUISITE] = UNIT_REQUIRED_BY,
15971597
[UNIT_REQUISITE_OVERRIDABLE] = UNIT_REQUIRED_BY_OVERRIDABLE,
1598-
[UNIT_BIND_TO] = UNIT_BOUND_BY,
1598+
[UNIT_BINDS_TO] = UNIT_BOUND_BY,
15991599
[UNIT_REQUIRED_BY] = _UNIT_DEPENDENCY_INVALID,
16001600
[UNIT_REQUIRED_BY_OVERRIDABLE] = _UNIT_DEPENDENCY_INVALID,
16011601
[UNIT_WANTED_BY] = _UNIT_DEPENDENCY_INVALID,
1602-
[UNIT_BOUND_BY] = UNIT_BIND_TO,
1602+
[UNIT_BOUND_BY] = UNIT_BINDS_TO,
16031603
[UNIT_CONFLICTS] = UNIT_CONFLICTED_BY,
16041604
[UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
16051605
[UNIT_BEFORE] = UNIT_AFTER,
@@ -1609,8 +1609,8 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
16091609
[UNIT_REFERENCED_BY] = UNIT_REFERENCES,
16101610
[UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
16111611
[UNIT_TRIGGERED_BY] = UNIT_TRIGGERS,
1612-
[UNIT_PROPAGATE_RELOAD_TO] = UNIT_PROPAGATE_RELOAD_FROM,
1613-
[UNIT_PROPAGATE_RELOAD_FROM] = UNIT_PROPAGATE_RELOAD_TO
1612+
[UNIT_PROPAGATES_RELOAD_TO] = UNIT_RELOAD_PROPAGATED_FROM,
1613+
[UNIT_RELOAD_PROPAGATED_FROM] = UNIT_PROPAGATES_RELOAD_TO
16141614
};
16151615
int r, q = 0, v = 0, w = 0;
16161616

@@ -2519,7 +2519,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
25192519
if (r < 0)
25202520
return r;
25212521

2522-
if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BIND_TO, device, true)) < 0)
2522+
if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
25232523
return r;
25242524

25252525
if (wants)
@@ -2765,7 +2765,7 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
27652765
[UNIT_REQUISITE_OVERRIDABLE] = "RequisiteOverridable",
27662766
[UNIT_REQUIRED_BY] = "RequiredBy",
27672767
[UNIT_REQUIRED_BY_OVERRIDABLE] = "RequiredByOverridable",
2768-
[UNIT_BIND_TO] = "BindTo",
2768+
[UNIT_BINDS_TO] = "BindsTo",
27692769
[UNIT_WANTED_BY] = "WantedBy",
27702770
[UNIT_CONFLICTS] = "Conflicts",
27712771
[UNIT_CONFLICTED_BY] = "ConflictedBy",
@@ -2777,8 +2777,8 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
27772777
[UNIT_ON_FAILURE] = "OnFailure",
27782778
[UNIT_TRIGGERS] = "Triggers",
27792779
[UNIT_TRIGGERED_BY] = "TriggeredBy",
2780-
[UNIT_PROPAGATE_RELOAD_TO] = "PropagateReloadTo",
2781-
[UNIT_PROPAGATE_RELOAD_FROM] = "PropagateReloadFrom"
2780+
[UNIT_PROPAGATES_RELOAD_TO] = "PropagatesReloadTo",
2781+
[UNIT_RELOAD_PROPAGATED_FROM] = "ReloadPropagatedFrom"
27822782
};
27832783

27842784
DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);

src/core/unit.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ enum UnitDependency {
7676
UNIT_REQUISITE,
7777
UNIT_REQUISITE_OVERRIDABLE,
7878
UNIT_WANTS,
79-
UNIT_BIND_TO,
79+
UNIT_BINDS_TO,
8080

8181
/* Inverse of the above */
8282
UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisite' is 'required_by' */
8383
UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */
8484
UNIT_WANTED_BY, /* inverse of 'wants' */
85-
UNIT_BOUND_BY, /* inverse of 'bind_to' */
85+
UNIT_BOUND_BY, /* inverse of 'binds_to' */
8686

8787
/* Negative dependencies */
8888
UNIT_CONFLICTS, /* inverse of 'conflicts' is 'conflicted_by' */
@@ -100,8 +100,8 @@ enum UnitDependency {
100100
UNIT_TRIGGERED_BY,
101101

102102
/* Propagate reloads */
103-
UNIT_PROPAGATE_RELOAD_TO,
104-
UNIT_PROPAGATE_RELOAD_FROM,
103+
UNIT_PROPAGATES_RELOAD_TO,
104+
UNIT_RELOAD_PROPAGATED_FROM,
105105

106106
/* Reference information for GC logic */
107107
UNIT_REFERENCES, /* Inverse of 'references' is 'referenced_by' */

0 commit comments

Comments
 (0)