vzctl stop: try to untangle CT IP cleanup mess
OK, here is a mess.
First, vps_stop() calls vps_cleanup_res() which calls run_net_script()
which calls external shell script vps_net-del to clean up CT IPs.
One problem is vps_cleanup_res() is called with STATE_STOPPING, which
is ignored and run_net_script() is called with STATE_RUNNING (for
whatever reason).
Second, vps_stop() calls external shell script vps-stop which is
supposed to take IP_ADDR environment variable. The problem is IP_ADDR
is never passed. It's not a problem really since IP addresses were
cleaned up already, there's actually no need for vps-stop at all.
This is how we try to untangle it:
1. Remove vps_cleanup_res(), do call run_net_script() directly.
2. Supply STATE_STOPPING to the vps_net-del script.
3. In vps_net-del, remove a file with CT IPs in case CT is stopping.
4. Remove vps_stop and call to it -- it wasn't working/needed anyway.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 files changed