[Users] Execute command on host when container stops

Kir Kolyshkin kir at openvz.org
Tue Mar 18 08:02:49 PDT 2014


On 03/18/2014 07:57 AM, Kir Kolyshkin wrote:
> On 03/18/2014 07:16 AM, Hristo Benev wrote:
>> Hi,
>>
>> is there a way to execute command on host node when I'm shutting 
>> down/(re)start container?
>
> Please see man vzctl, section ACTION SCRIPTS, or 
> https://openvz.org/Man/vzctl.8#ACTION_SCRIPTS
>
> --kir
>

Having said that, your best bet will be umount script, which is executed 
in host system context
after CT is stopped. The only problem is it is also executed when CT is 
unmounted (say as it
vzctl mount $CTID && vzctl umount $CTID for a stopped container).


More information about the Users mailing list