[Lxc-users] Viewing a container's /proc mount from the host
Stéphane Graber
stgraber at ubuntu.com
Thu Sep 6 21:05:46 UTC 2012
On 12-09-06 04:55 PM, Ken Elkabany wrote:
> Hi,
>
> We're trying to find the ports that a container is currently listening
> on. This information is available from /proc/net/tcp and /proc/net/udp.
> However, as far as I can tell, the host cannot view a container's /proc
> mount due to namespacing. We would prefer to view those files from the
> host, rather than connecting to the container's tty, and viewing it from
> within the container.
>
> As an aside, we do not want to use port scanning.
>
> Best,
> Ken
The net entries can be accessed using /proc/<pid on host>/net/{udp|tcp},
no need to actual access the /proc of the container.
lxc-netstat -n <container> may also help you get what you want.
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120906/312cfd47/attachment.pgp>
More information about the lxc-users
mailing list