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

Andrey Repin anrdaemon at yandex.ru
Tue May 19 13:22:13 UTC 2015


Greetings, Sungbae Yoo!

>>>> This has me always wondering.

>>>> How do you know that only your container is using the service?

>>>> Last time I saw this idiocy is when iSCSI service was blindly killing 
>>>> all _netdev mounts when stopped. Guess, how many NON-iSCSI shares were killed?

>>> I mean the services that added newly for containers when container is 
>>> created. Not for the existed before.

>> I understand, that they were added when container was created.
>> How do you know, that they aren't used by anything else NOW?

> I just think a service that create a network bridge only for containers.
> When container is destroyed, if this is the last one,
> This service doesn't need to run.

This can be easily controlled by the system init scripts.
You don't need to *delete* the bridge configuration, but shutting bridge down
and restarting it when not/needed is a likely possibility.


-- 
With best regards,
Andrey Repin
Tuesday, May 19, 2015 16:01:54

Sorry for my terrible english...



More information about the lxc-users mailing list