<term><varname>JoinsNamespaceOf=</varname></term>
<listitem><para>For units that start processes (such as service units), lists one or more other units
- whose network and/or temporary file namespace to join. This only applies to unit types which support
- the <varname>PrivateNetwork=</varname>, <varname>NetworkNamespacePath=</varname>,
+ whose network and/or temporary file namespace to join. If this is specified on a unit (say, a.service
+ has <varname>JoinsNamespaceOf=b.service</varname>), then this the inverse dependency
+ (<varname>JoinsNamespaceOf=a.service</varname> for b.service) is implied. This only applies to unit
+ types which support the <varname>PrivateNetwork=</varname>, <varname>NetworkNamespacePath=</varname>,
<varname>PrivateIPC=</varname>, <varname>IPCNamespacePath=</varname>, and
<varname>PrivateTmp=</varname> directives (see
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
details). If a unit that has this setting set is started, its processes will see the same
<filename>/tmp/</filename>, <filename>/var/tmp/</filename>, IPC namespace and network namespace as
- one listed unit that is started. If multiple listed units are already started, it is not defined
- which namespace is joined. Note that this setting only has an effect if
- <varname>PrivateNetwork=</varname>/<varname>NetworkNamespacePath=</varname>,
+ one listed unit that is started. If multiple listed units are already started and these do not share
+ their namespace, then it is not defined which namespace is joined. Note that this setting only has an
+ effect if <varname>PrivateNetwork=</varname>/<varname>NetworkNamespacePath=</varname>,
<varname>PrivateIPC=</varname>/<varname>IPCNamespacePath=</varname> and/or
<varname>PrivateTmp=</varname> is enabled for both the unit that joins the namespace and the unit
whose namespace is joined.</para></listitem>
return r;
notify = r > 0;
- if (inverse_table[d] != _UNIT_DEPENDENCY_INVALID && inverse_table[d] != d) {
- r = unit_add_dependency_hashmap(&other->dependencies, inverse_table[d], u, 0, mask);
- if (r < 0)
- return r;
- notify_other = r > 0;
- }
+ assert(inverse_table[d] >= 0 && inverse_table[d] < _UNIT_DEPENDENCY_MAX);
+ r = unit_add_dependency_hashmap(&other->dependencies, inverse_table[d], u, 0, mask);
+ if (r < 0)
+ return r;
+ notify_other = r > 0;
if (add_reference) {
r = unit_add_dependency_hashmap(&u->dependencies, UNIT_REFERENCES, other, mask, 0);