[Lxc-users] Refreshing for 2013: LXC hiding container processes from Host/HN's 'ps'

Serge Hallyn serge.hallyn at ubuntu.com
Fri Feb 22 14:32:55 UTC 2013


Quoting Guido Jäkel (G.Jaekel at DNB.DE):
> 
> Dear Ian,
> 
> to support your request in a convenience way, i recently drop in a small patch for the  lxc-ps  helper command. Using the LXC-aware frontend for ps, you're able to filter the ps output down to a (set of) named container or all of them. With the patch applied, you're now able to filter it down to the oposite: The processes not in any container ns, i.e. that of the host.

It just occurred to me, that patch actually doesn't do what is
advertised after introduction of lxcpath support.

Each lxcpath has its own monitor, and iiuc (i don't have the
patch in front of me) the patch makes --host simply print
out any tasks not known by the default monitor to be in a
container.

So if I do

	sudo lxc-start -n r1
	sudo lxc-start -n r2 -P $HOME/lxcbase

then tasks in r2 will show up when I do
	sudo lxc-ps --host
and tasks in r1 will show up when I do
	sudo lxc-ps -P $HOME/lxcbase --host

-serge




More information about the lxc-users mailing list