A simple script to demonstrate this problem is attached below.
It appears that s6-rc-update will neglect to create the needed pipes in the
following situation:
1. A service X is already running before s6-rc-update is invoked
2. Service X was not the consumer-for any other service prior to s6-rc-u
Quoting Adam Joseph (2023-09-25 17:44:18)
> + /*
> +Note: the following will fail if you have a singleton bundle
> +and try to rename both the bundle and the thing it contains
> +in the same s6-rc-update invocation. Parts of this loop
> +sho
Quoting Adam Joseph (2023-09-25 17:44:17)
> The loop is O(n^2) due to the nested iteration. We can rewrite this
> with a single iteration by making use of the invimage[] array, which
> maps from new services to old services:
>
>for each new service
> if *ANY* old servi
This commit adds additional explanatory comments for parts of
s6-rc-update.c that did not seem immediately obvious to me.
It is probably not appropriate to apply this commit verbatim in its current
form. Feel free to pick changes from it selectively.
Signed-off-by: Adam Joseph
---
src/s6-rc
services:
for each new service
if *ANY* old service converts to the new service,
set some new service flags based on that old service's flags
This takes advantage of the fact that invimage is an injective
(partial) function.
Signed-off-by: Adam Joseph
---
src/s6-rc/s6-rc-upd
than add the
descriptive identifiers and replace integers with their
corresponding identifier-combinations. Therefore it should be
straightforward to locally verify the correctness of each change in
this commit.
Signed-off-by: Adam Joseph
---
src/s6-rc/s6-rc-update.c | 167 +++-
immediately obvious to me.
Signed-off-by: Adam Joseph
---
src/libs6rc/s6rc_graph_closure.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/src/libs6rc/s6rc_graph_closure.c b/src/libs6rc/s6rc_graph_closure.c
index 7c3a8f9..50af30b 100644
--- a/src/libs6rc/s6rc_graph_closure.c
+++ b/src
While reviewing the source code for s6-rc-update I noticed that it
has special handling for singleton bundles; these are not explicitly
defined in the documentation, nor is this behavior described. This
commit does so.
Signed-off-by: Adam Joseph
---
doc/s6-rc-compile.html | 9 +
doc
rules for singleton bundles (see next
patch in series) depend on this flattening behavior.
Signed-off-by: Adam Joseph
---
doc/s6-rc-compile.html | 3 +++
1 file changed, 3 insertions(+)
diff --git a/doc/s6-rc-compile.html b/doc/s6-rc-compile.html
index e1ad82b..ef06893 100644
--- a/doc/s6-rc