[Devel] What should init do on halt/reboot?

Pavel Emelyanov xemul at openvz.org
Mon Sep 29 05:09:53 PDT 2008


Arjan Schrijver wrote:
> Pavel Emelyanov wrote:
>> Arjan Schrijver wrote:
>>   
>>> Hi people,
>>>
>>> Currently I am investigating why OpenRC (the upcoming Gentoo init 
>>> package) doesn't work well in OpenVZ containers.
>>> The problem I have is that when the container is stopped with the 'halt' 
>>> or 'reboot' commands inside the container, the init process doesn't 
>>> terminate.
>>> What should init do to let OpenVZ know that the container must be 
>>> stopped or rebooted?
>>>     
>> AFAIK it should just die... Doesn't it do so?
>>   
> No it doesn't... The init process keeps running. This is something I 
> have contacted the OpenRC author about.
> However, his question is what init should do when it is rebooting or 
> halting the machine.
> When I simply kill init after a few minutes, the VZ state of the 
> container is 'mounted', which it should only be when rebooted from 
> inside the container.
> That is how my question came to mind: is there some signal init should 
> send to OpenVZ or the 'hardware' that it is shutting down or rebooting?

It's a complex thing. I once investigated this question and found out, 
that (at least some) init-s calls /etc/init.d/halt, which in turn calls 
killall to terminate all the rest process and finally calls reboot/shutdown 
to park the node. 

> Thanks,
> Arjan
> 




More information about the Devel mailing list