I would like to implement the functionality similar to pid file but for network namespace. In common file namespace the process can lock pid file and ensure that no other process is running in the same file name space just by checking that it can receive write permission on it. I would like to have the same but for network namespace.
Consider a situation where applications run in different filename spaces but in the same network space (like two containers bridged directly to the host machine network namespace).
Instead of pid I would like to assign each process some abstract instance. No two processes with the same instance id and sharing the same network namespace should be able to run simultaneously.
Bind on some port would not do, as many applications should be able to bind on on the same port.
I encountered the mroute socket however it is used by pimd daemon.