Open deliciouslytyped opened 4 years ago
Err, I wrote the issue but something might still be messed up on my part so I still need to check some things...
So, for my specific case, systemd-nspawn in the container ExecStart is what provides the host veth, which means that the host veth needs to/can be be configured immediately after nspawn starts running, but before it finishes or times out. (I'm not sure how exactly it works but I'm assuming it stops blocking with respect to systemd service queueing when the contianer comes up somehow.)
Apparently the systemd service is of notify
type, which makes a lot of sense given the above; ; however, it is expected that the service sends a notification message via sd_notify(3) or an equivalent call when it has finished starting up.
- infinisil mentioned something suggesting that execstart would block the service forever unless something else is happening.
The code responsible for bringing up the host veth is currently in ExecStartPost and that's too late.
So, I think interfaces should be brought up as soon as the device appears, since that is the logical dependency.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
I can confirm this problem.
Take for example, the Gitlab module: gitlab-db-config.service
needs to communicate with the Postgresql server, which is reachable over network, but network will not be set online until the service has finished.
@deliciouslytyped Have you found a good solution for this?
From what I can see every service that requires network access to startup successfully (e.g. gitlab as described by @alex-fu27) is unsupported in nixos containers.
I haven't touched this in 5 (wow) years, sorry. :(
To be able to view this problem through a more concrete lens, I have the following situation:
Therefore, the vpn cannot download the configuration files until the vpn is up, contradiction.
I did a dirty hack of just dumping the postscript into the prescript so the interface is brought up properly on time, and this seems to work(did it in the wrong place, don't have a solution yet) - but is there a better solution? Will pre-activating the interface break anything? Is there some refactoring possible in the above linked implementation?