If some containers depend on each other, how can I ensure they start in the correct order? If that’s not possible, I’m fine with disabling auto-start on boot.
thanks!
If some containers depend on each other, how can I ensure they start in the correct order? If that’s not possible, I’m fine with disabling auto-start on boot.
thanks!
Unfortunately, I don’t think there’s a “good” way to do it.
The containers default to an on-failure restart policy, so best case if the parent container isn’t up yet, then the child container will restart until it works. This would require the child container to actually fail, and not simply just not work.
You could of course script this so that post-boot and post-commit, the child container does a podman container inspect of the parent, and restarts itself if needed depending on: a) The parent isn’t healthy and/or b) the child isn’t working correctly.
You can also override the entrypoint in the child containers, and apply a sleep timer before the entrypoint is executed. Hopefully allowing time for the parent to come up.
This does bring up the idea of a useful feature request though. Since VyOS builds containers into a systemd service, it can add Require and `After fields.
I’ll go ahead and generate a feature request for that.
Here’s the Task for the feature request: ⚓ T7769 Containers: Add 'Requires' and 'After'
Containers started in alphanumeric sequences.
You can rename containers to check.
thank you and viacheslav!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.