[lxc-devel] [PATCH 1/1] lxc-ps: Nit - Avoid blank CONTAINER column

Michel Normand normand at fr.ibm.com
Fri Feb 12 07:48:20 UTC 2010


Le jeudi 11 février 2010 à 10:19 -0800, Sukadev Bhattiprolu a écrit :
> Serge E. Hallyn [serue at us.ibm.com] wrote:
> | Quoting Michel Normand (normand at fr.ibm.com):
> | > Le jeudi 11 février 2010 à 11:08 +0100, Michel Normand a écrit :
> | > > Le mercredi 10 février 2010 à 20:25 -0800, Sukadev Bhattiprolu a écrit :
> | > > > From: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
> | > > > Date: Wed, 10 Feb 2010 20:09:17 -0800
> | > > > Subject: [PATCH 1/1] lxc-ps: Nit - Avoid blank CONTAINER column
> | > > > 
> | > > > The contianer name is not printed in the lxc-ps output unless the --lxc
> | > > > option is specified.  But the CONTAINER column is printed (and left
> | > > > blank) even if the --lxc option is not specified.
> | > > > 
> | > > > 	$ /usr/local/bin/lxc-ps -n foo
> | > > > 	CONTAINER    PID TTY          TIME CMD
> | > > > 		   19525 pts/2    00:00:01 bash
> | > > > 		   20311 pts/2    00:00:00 lxc-ps
> | > > > 		   20312 pts/2    00:00:00 ps
> | > > 
> | > > For me the error in the script is 
> | > > to report default pid of ps command,
> | > > rather than to report the pids of specified 'foo' 
> | > > container in this case.
> | > > 
> | > > So a patch should address this point,
> | > > rather to remove the container column.
> | > 
> | > In fact there is no error in the script :)
> | > The -n option for lxc-ps is a ps option ! 
> 
> Ah, good point. Like Serge pointed, I got the -n mixed up with other
> lxc- commands.
> 
> Even so, I still think the blank CONTAINER column is misleading.
> Does it mean that the listed processes are not part of any container ?
> Like /bin/ps which prints, say the PGID column, only wuiuihen selected,
> wouldn't it make sense to print the CONTAINER column only when necessary ?
> 

The purpose of the CONTAINER column printed in any case,
is to be able to have the relations of processes in containers
versus their parents outside of containers.
when you do a request like lxc-ps axf

---
Michel

> Thanks,
> 
> Sukadev






More information about the lxc-devel mailing list