[Bug 1043018] [NEW] lxc-ls lists running containers multiple times

Dan Kegel dank at kegel.com
Tue Aug 28 23:51:01 UTC 2012


Public bug reported:

This seems wrong:

$ lxc-ls
demo_centos5  demo_centos6  demofedora16  demo_ubuntu_1004  demo_ubuntu_1204  demo_ubuntu_1204-temp-NjwI1BQ  ubu12-bb-01-ubu12
ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12
ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12  ubu12-bb-01-ubu12

Lessee: lxc-ls does
active=$(netstat -xa 2>/dev/null | grep $lxcpath | \
        sed -e 's#.*'"$lxcpath/"'\(.*\)/command#\1#');

which expands to

++ netstat -xa
++ grep /var/lib/lxc
++ sed -e 's#.*/var/lib/lxc/\(.*\)/command#\1#'
+ active='ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
ubu12-bb-01-ubu12
...

netstat -xa | grep /var/lib/lxc shows
$ netstat -xa | grep /var/lib/lxc
unix  2      [ ACC ]     STREAM     LISTENING     1509155  @/var/lib/lxc/ubu12-bb-01-ubu12/command
unix  2      [ ]         STREAM     CONNECTING    0        @/var/lib/lxc/ubu12-bb-01-ubu12/command
unix  2      [ ]         STREAM     CONNECTING    0        @/var/lib/lxc/ubu12-bb-01-ubu12/command
unix  3      [ ]         STREAM     CONNECTING    0        @/var/lib/lxc/ubu12-bb-01-ubu12/command

So,  perhaps that should be grep "LISTENING.*$lxcpath" ?

** Affects: lxc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1043018

Title:
  lxc-ls lists running containers multiple times

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1043018/+subscriptions



More information about the Ubuntu-server-bugs mailing list