I am running an ubuntu precise host with some lxc containers in it. Should or have i to shut down containers before shutting down the host ? Or host shutdown is propagated to containers automatically ? I know if i use lxc autostart feature, then that will shutdown containers, but i do not want to use autostart.

有帮助吗?

解决方案

The containers themselves are usually running on the host system's filesystem, and don't have their own filesystem. This means that from filesystem point of view, you can just kill LXC without risking any filesystem corruptions.

But if you have services running inside LXC, like for example MySQL, or other services that require a clean shut down for their own data stores, then it's important that these processes get stopped cleanly. Otherwise you risk causing corruptions on the data store of these services.

If you use the script in /etc/init.d to start your LXCs, they should get the signal to shutdown automatically once you shut down your host system, because init will call the /etc/init.d/ stop. If you started them manually, like via lxc-start on the CLI, and you want to be sure that they get shut down cleanly, it's better if you do it manually before shutting down the host system.

hope that helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top