lxc-stop -n unknown-container creates a corrupted container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Running lxc-stop on a container which doesn't exist actually creates the container, and messes up its permissions, causing sequences like:
$ lxc-stop -n foo && lxc-destroy -n foo && lxc-clone clean-machine foo
..to fail with bad errors:
# it definitely doesn't exist to start with:
% lxc-ls foo
% lxc-info -n foo
foo doesn't exist
% ls ~/.local/
ls: cannot access /home/faux/
# now let's stop it:
% lxc-stop -n foo
foo is not running
# tooling still thinks it doesn't exist:
% lxc-ls foo
% lxc-info -n foo
foo doesn't exist
# .. but there are some files!
% ls ~/.local/
total 0
drwxr-xr-x 1 faux faux 14 Jul 23 09:45 .
drwxr-xr-x 1 faux faux 8070 Jul 23 09:45 ..
-rw-rw-r-- 1 faux faux 0 Jul 23 09:45 foo.log
# and now lxc-clone is totally broken:
% lxc-clone base foo
lxc_container: lxccontainer.c: lxcapi_clone: 2707 Permission denied - open /home/faux/
clone failed
Can we worked around by manually rm -rfing ~/.local/
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: lxc 1.1.2-0ubuntu3
ProcVersionSign
Uname: Linux 3.19.0-22-generic x86_64
NonfreeKernelMo
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
Date: Thu Jul 23 09:45:56 2015
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
stgraber@ dakara: ~/data/ code/lxc/ lxd (stgraber/master)$ lxc-stop -n foo ; lxc-destroy -n foo ; lxc-clone clean-machine foo
foo is not running
Container is not defined
Error: container clean-machine is not defined