[lxc-users] How to run scripts when container is destroyed?

Andrey Repin anrdaemon at yandex.ru
Tue May 12 17:11:47 UTC 2015


Greetings, Michael H. Warfield!

>> > Im making a template script for container.
>> > 
>> > I want to install some packages when container is created and uninstall the
>> > packages when container is destroyed.
>> > 
>> >  
>> > 
>> > The former can be resolved simply by insert package command into template.
>> > 
>> > How to resolve the latter? Is there no way to insert any hook script in
>> > destroy?
>> 
>> Nope, there is currently no lxc.hook.destroy.  A patch to add it
>> would be welcome as a conversation piece, though we'd have to
>> think about it to decide whether it makes sense.  I think it might.

> I concur it might.  I could envision some sort of external registry or
> interface that could be signaled of a "destroy" event and update
> accordingly.

Could you provide a use case, other than "it might"?
When container is destroyed, nobody care what it contained.
Or do you mean uninstalling certain packages ON HOST?


-- 
With best regards,
Andrey Repin
Tuesday, May 12, 2015 20:10:47

Sorry for my terrible english...



More information about the lxc-users mailing list