[Lxc-users] regarding lxc "states" available to lxc-monitor or lxc-wait usage

Serge Hallyn serge.hallyn at ubuntu.com
Wed May 8 17:42:14 UTC 2013


Quoting brian mullan (bmullan.mail at gmail.com):
> I've been trying to find what all the container states are that lxc-monitor
> and lxc-wait can utilize?
> 
> man pages don't indicate them
> 
> I know that the following are available:
> 
>    - starting
>    - running
>    - stopping
>    - stopped
>    - frozen
> 
> Thats a pretty limited set of "states" but are there others?

>From src/lxc/start.h:

 typedef enum {
 	        STOPPED, STARTING, RUNNING, STOPPING,
 		        ABORTING, FREEZING, FROZEN, THAWED, MAX_STATE,
 } lxc_state_t;

Note that stopped can also mean undefined.

> *Is there any ability to establish local use-case "private states" that
> could be reported via the        lxc-monitor or used by the lxc-wait commands
> ?  *

Not right now, but that's an interesting idea.

> If not do any of you think this capability would be valuable?
> 
> Here's my example use-case...
> 
> *Say I have a container app and I want to know when it has finished some
> initialization task it would be great to be able to somehow utilize
> lxc-monitor or to use lxc-wait in a script that looked for my "private
> state" to be reported and then take some further action or initiate some
> other activity.*

This reminds me of discussions in years past about 'service readiness'
indication (i.e. for upstart).

I'm not sure how userspace in the container would go about informing the
monitor of the new state.  Any ideas?

-serge




More information about the lxc-users mailing list