aurae-runtime / auraed

Secure mTLS and gRPC backed runtime daemon. Alternative to systemd. Written in Rust.
https://aurae.io/auraed
Apache License 2.0
60 stars 11 forks source link

Manage multiple auraed instances #16

Open krisnova opened 1 year ago

krisnova commented 1 year ago

Right now we can start 2 auraed instances... we shouldn't be able to do that

MalteJ commented 1 year ago

If we decide to integrate firecracker into auraed, we'd need to spawn a second, "jailed", auraed instance from the main (pid 1) auraed instance. This second instance would then act as the MicroVM's hypervisor.

If you simply try to start two auraed instances in parallel, there'll be an error that the socket is already in use. I'm not sure if we really got a problem with multiple auraed instances.

MalteJ commented 1 year ago

ahh sorry, I haven't tested starting auraed twice. The problem is this line: https://github.com/aurae-runtime/auraed/blob/755efd3527c371ad521eda03011dc2e70892d17c/src/lib.rs#L100

During initialization of auraed we remove the socket if it already exists. Probably the file descriptor stays open so the first auraed keeps running, but the file is gone and replaced by the second auraed's socket.

MalteJ commented 1 year ago

Probably the above mentioned line should be removed completely. Instead we should delete the socket during auraed's shutdown as described in #36