Bug 1138528
| Summary: | lxc-stop not working as expected | ||
|---|---|---|---|
| Product: | [Fedora] Fedora EPEL | Reporter: | Sklav <gnudna> |
| Component: | lxc | Assignee: | Thomas Moschny <thomas.moschny> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | epel7 | CC: | karlthered, mhw, sagarun, thomas.moschny |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-09-17 01:30:09 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Sklav
2014-09-05 05:46:34 UTC
This is an issue with SIGPWR handling in the container. The lxc-stop command now issues a SIGPWR signal to the container init and then waits a time out period for the container to gracefully shut down and exit. The container init process must handle that signal and shut down gracefully. If it fails to shut down gracefully before a timeout, lxc-stop will then kill the container. The Debian container (probably sysvinit or lsbinit) has to be configured to handle the SIGPWR signal an initiate a shutdown. Alternative is to simply issue a "lxc-stop -k" or set a very short timeout. But this doesn't do and orderly shutdown in the container. The proper solution is to reconfigure the Debian container to shut down on SIGPWR. That can probably (should probably) be set up in the Debian template but all existing (old) containers will have to be reconfigured manually. The old behavior of lxc-stop pre-1.0 was to unceremoniously kill the container, which can lead to corrupted database and other mayhem from the container not shutting down gracefully. The current lxc-stop is behaving as designed and as expected. The problem is a configuration issue in the container. Strange... I just now tested a Debian Wheezy container on my Fedora 20 server. Running lxc-stop -n {container} shuts the container down in about 3 or 4 seconds, no problem.
Does your container have this line in /etc/inittab?
p0::powerfail:/sbin/init 0
Did you install and alternate init system (upstart or systemd)?
I can confirm that on my template in inittab p0::powerfail:/sbin/init 0 was not being added. this is due to the containers having been migrated from an older lxc base. I have added it to existing containers and all is working as expected. So we can consider this resolved. Sorry for the inconvenience |