Details
Description
Memcached currently allows for dynamic reconfiguration of network interfaces, but it is not very robust. The initial load of the configuration is robust as memcached refuse to start if it fails to bind any of the interfaces marked as required. Any later modification is however "risky" as we might not be able to bind to the port, and there is no way to tell ns_server about the failure (and ns_server would think that memcached is using the provided interfaces and may tell clients to use them).
To fix this "once and for all" we should remove the interface section from memcached.json and let memcached start and let the kernel pick an ephemeral port we store in a filename provided in memcached.json. ns_server should then connect (and auth) to that port and run a new command to create / remove a port binding (pretty much like ifconfig works in the shell). memcached will then be able to report back to ns_server if it encounters any problems binding to the interface, and ns_server can take the appropriate action IF it fail to open the port.