[Lxc-users] On clean shutdown of Ubuntu 10.04 containers
Trent W. Buck
twb at cybersource.com.au
Tue Dec 7 00:58:29 UTC 2010
"Brian K. White" <brian at aljex.com> writes:
> On 12/6/2010 6:49 PM, Trent W. Buck wrote:
>> "Brian K. White"<brian at aljex.com> writes:
>>
>>> On 12/6/2010 2:42 AM, Trent W. Buck wrote:
>>>> I use the latter in my customized /etc/init.d/lxc stop rule.
>>>> Note that the lxc-wait's SHOULD be parallelized, but this is not
>>>> possible as at lxc 0.7.2 :-(
>>>
>>> Sure it is.
>>
>> Sorry, I meant lxc-wait(8) cannot be parallelized.
>>
>>> I parallelize the shutdowns (in any version, including 0.7.2) by doing
>>> all the lxc-stop in parallel without looking or waiting,
>>
>> Correct me if I'm wrong, but lxc-stop does NOT do a clean shutdown -- it
>> just kill -9's all the processes in the container.
>
> If you read the script, I do not issue lxc-stop anywhere directly, I
> only issue "kill -PWR $PID" where $PID is the containers /sbin/init.
>
> lxc does the actual lxc-stop internally if/when the container reaches
> the state where it's ok to do so.
OK, cool. I'm doing the same thing, I just misunderstood your earlier
post.
> One problem with this is it means a hung or misconfigured container
> can prevent the host from ever shutting down (gracefully) which I
> think is preferable to the other way around except for the case of if
> the host is trying to go down because of impending power outtage.
I took the view that hard-killing (lxc-stop) hung containers was the
Right Thing when the host was trying to shut down, by analogy to how
processes are stopped in a normal system:
Sending HUP to all processes...
[timeout]
Sending KILL to all processes...
cf.
[send PWR to all container inits]
[timeout]
[call lxc-stop on any still-running containers]
Your example of shutting down in response to a UPS freakout is the kind
of thing I was thinking of. YMMV, etc.
More information about the lxc-users
mailing list