[lxc-users] LXD: error: open /etc/subuid: no such file or directory
Michael H. Warfield
mhw at WittsEnd.com
Wed Nov 12 22:33:09 UTC 2014
On Wed, 2014-11-12 at 15:35 -0600, Tycho Andersen wrote:
> On Wed, Nov 12, 2014 at 01:42:23PM -0600, Tycho Andersen wrote:
> > On Wed, Nov 12, 2014 at 06:55:22PM +0000, Serge Hallyn wrote:
> > > Make sure no other lxd is running
> > >
> > > sudo killall -9 lxd
> > >
> > > and remove the sock by hand
> > >
> > > sudo rm /var/lib/lxd/unix.socket
> > >
> > > Now it should start fine.
> > >
> > > If we are leaving that socket around when we error out bc of no
> > > availalbe subuids, then that is definately a bug.
> >
> > Yes, I've seen this before. I'll look into it and send a patch.
> Hmm. On closer inspection it looks like we should be cleaning things
> up correctly. However, I know that I've seen something like this
> before, so if I figure out how to reproduce it (or if someone can tell
> me how to reproduce it), I can send a patch.
Ah... Point of order. Rewind back up about three lines of
indentation...
"sudo killall -9 lxd"
If that is ever done without this:
"sudo rm /var/lib/lxd/unix.socket"
You are going to be screwed. We should avoid, at all costs, needing a
-9 (SIGKILL) unless all other avenues have been exhaused. Need to make
sure other signals are caught as well. Arbitrarily saying "killall -9"
is instilling bad habits and corruption can arise.
Better yet, this should have interlocking and garbage collection on
startup. On startup, check for another daemon (run time pid file and
existence of socket and activity - ping on socket) and exit cleanly if
there is. Provide for an ordered shutdown. If daemon pid is not
present or not running, remove the socket on startup. If the pid file
is there and the process is present and the socket is present but the
process is not responding in a reasonable time then STONITH (Shoot The
Other Node In The Head). This should be managible at daemon startup.
Regards,
Mike
> Tycho
>
> > Tycho
> >
> > > Quoting Kunal Kushwaha (kunalkushwahaoss at gmail.com):
> > > > Hi
> > > >
> > > > Thanks for your quick reply.
> > > > It has resolved the issue, but now I am facing another issue.
> > > >
> > > >
> > > > $sudo ./lxd --tcp 10.0.3.1:8888
> > > > error: cannot listen on unix socket: listen unix
> > > > /var/lib/lxd/unix.socket: bind: address already in use
> > > >
> > > > I confirmed these port are not used, and have tried other ports too.
> > > >
> > > > Regards,
> > > > Kunal Kushwaha
> > > >
> > > >
> > > >
> > > > On Wed, Nov 12, 2014 at 11:40 PM, Tycho Andersen
> > > > <tycho.andersen at canonical.com> wrote:
> > > > > On Wed, Nov 12, 2014 at 11:38:17PM +0530, Kunal Kushwaha wrote:
> > > > >> Hi Stéphane,
> > > > >>
> > > > >> I am now setting up my dev environment in ubuntu-trusty-32 with
> > > > >> kernel 3.13.0-39-generic.
> > > > >> Now I am getting problem
> > > > >>
> > > > >> root at vagrant-ubuntu-trusty-32:/home/vagrant/go/src/github.com/lxc/lxd/lxd# ./lxd
> > > > >> error: User "root" has no subuids.
> > > > >>
> > > > >>
> > > > >> Basically I am creating dev environment in vagrant.
> > > > >
> > > > > You can fix this by adding a root to /etc/subuid and /etc/subgid,
> > > > > something like:
> > > > >
> > > > > root:100000:65536
> > > > >
> > > > > should work. (Of course, you want to be sure that root's range doesn't
> > > > > overlap with anything that already exists.)
> > > > >
> > > > > Tycho
> > > > >
> > > > >>
> > > > >> Regards,
> > > > >> Kunal Kushwaha
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >> On Tue, Nov 11, 2014 at 11:53 PM, Stéphane Graber <stgraber at ubuntu.com> wrote:
> > > > >> > On Tue, Nov 11, 2014 at 11:51:01PM +0530, Kunal Kushwaha wrote:
> > > > >> >> Hi,
> > > > >> >>
> > > > >> >> I am trying setup development environment for lxd.
> > > > >> >> But I am facing issue of "error: open /etc/subuid: no such file or directory"
> > > > >> >>
> > > > >> >> $sudo ./lxd --tcp 127.0.0.1:8080
> > > > >> >> error: open /etc/subuid: no such file or directory
> > > > >> >>
> > > > >> >> Please help to resolve this.
> > > > >> >>
> > > > >> >> Regards,
> > > > >> >> Kunal Kushwaha
> > > > >> >
> > > > >> > You need a system with unprivileged LXC support, which currently means a
> > > > >> > 3.12 or higher kernel and a recent enough version of shadow to get you
> > > > >> > /etc/subuid and /etc/subgid as well as newuidmap and newgidmap.
> > > > >> >
> > > > >> > You can read more about that requirement of lxd at:
> > > > >> > - https://github.com/lxc/lxd/issues/19
> > > > >> > - https://github.com/lxc/lxd/blob/master/specs/userns-idmap.md
> > > > >> >
> > > > >> > --
> > > > >> > Stéphane Graber
> > > > >> > Ubuntu developer
> > > > >> > http://www.ubuntu.com
> > > > >> >
> > > > >> > _______________________________________________
> > > > >> > lxc-users mailing list
> > > > >> > lxc-users at lists.linuxcontainers.org
> > > > >> > http://lists.linuxcontainers.org/listinfo/lxc-users
> > > > >> _______________________________________________
> > > > >> lxc-users mailing list
> > > > >> lxc-users at lists.linuxcontainers.org
> > > > >> http://lists.linuxcontainers.org/listinfo/lxc-users
> > > > > _______________________________________________
> > > > > lxc-users mailing list
> > > > > lxc-users at lists.linuxcontainers.org
> > > > > http://lists.linuxcontainers.org/listinfo/lxc-users
> > > > _______________________________________________
> > > > lxc-users mailing list
> > > > lxc-users at lists.linuxcontainers.org
> > > > http://lists.linuxcontainers.org/listinfo/lxc-users
> > > _______________________________________________
> > > lxc-users mailing list
> > > lxc-users at lists.linuxcontainers.org
> > > http://lists.linuxcontainers.org/listinfo/lxc-users
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
--
Michael H. Warfield (AI4NB) | (770) 978-7061 | mhw at WittsEnd.com
/\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 465 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20141112/cdadbbfe/attachment.sig>
More information about the lxc-users
mailing list