You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some integration tests, I would need to be able to wait for container initialisation to be fully completed. The framework instrumenting the container needs this to be able to start a series of tests.
Unfortunately, I cannot rely on the service itself, as it may or may not be up, depending on configuration, so that I cannot for open ports or any other type of side-effects.
Ideally, the service I'd want to wait for is a oneshot, so that I cannot even use polling together with s6-svstat or readiness notification. Alternatively, being to check if s6-rc has completed init successfully would help.
Is there any other alternative to poll/wait for a oneshot to be up? In my case, that would be done from outside the container using something similar to docker exec.
The text was updated successfully, but these errors were encountered:
The natural notification for "the initialization has completed" is just "s6-rc exits 0", but it's true that there's currently no hook in rc.init to notify external programs that it's the case. If there's demand, I can probably add one in the future.
For now, your best bet is probably to add a oneshot that depends on top. Do not add that oneshot to any bundle, that would create a dependency loop and make your initialization fail.
In that oneshot, run whatever notification mechanism you want - write to a file, to a pipe, whatever. Make sure it doesn't block if your external program that needs the notification isn't present.
Since the oneshot depends on top, which is the bundle that s6-rc brings up at container initialization time, it will only run once everything else is up, which is the synchronization you want.
For some integration tests, I would need to be able to wait for container initialisation to be fully completed. The framework instrumenting the container needs this to be able to start a series of tests.
Unfortunately, I cannot rely on the service itself, as it may or may not be up, depending on configuration, so that I cannot for open ports or any other type of side-effects.
Ideally, the service I'd want to wait for is a
oneshot
, so that I cannot even use polling together withs6-svstat
or readiness notification. Alternatively, being to check ifs6-rc
has completed init successfully would help.Is there any other alternative to poll/wait for a oneshot to be
up
? In my case, that would be done from outside the container using something similar todocker exec
.The text was updated successfully, but these errors were encountered: