[lxc-users] Failing to create unprivileged container due to wrong /run/user/XXX/lock directory

Ranjib Dey dey.ranjib at gmail.com
Mon Jan 5 17:17:21 UTC 2015


following is the debug log:

MovePid: Client fd is: 6 (pid=10783, uid=111, gid=117)
cgmanager: Invalid path
/run/cgmanager/fs/hugetlb/user/1001.user/83.session/go
cgmanager:do_move_pid_main: Invalid path
/run/cgmanager/fs/hugetlb/user/1001.user/83.session/go
Disconnected from private client

1001 is wrong user (my login user), not `go` user's UID, which is 100.
/run/cgmanager/fs/hugetlb/ directory is empty,



On Mon, Jan 5, 2015 at 8:15 AM, Serge Hallyn <serge.hallyn at ubuntu.com>
wrote:

> Quoting Ranjib Dey (dey.ranjib at gmail.com):
> > I was able to resolve the lock issue, today. It seems like the
> environment
> > variable XDG_RUNTIME_DIR holds the value of that directory per-user.
> while
>
> Oh, nm my last response :)
>
> > using sudo it didn't change the directory, and still set to the login
> user.
> > I found the correct directory using `ls -alh /run/user/*` (the one thats
> > owned by the lxc user), and then manually setting the XDG_RUNTIME_DIR to
> > that path. Afterwards lxc-create works.
> > But now im getting a different error due to dbus, it looks like cgmanager
> > call to create cgroup is failing
> >
> >
> >   lxc-start 1420309721.946 ERROR    lxc_cgmanager - call to
> > cgmanager_create_sync failed: invalid request
> >   lxc-start 1420309721.946 ERROR    lxc_cgmanager - Failed to create
> > hugetlb:testx
> >   lxc-start 1420309721.946 ERROR    lxc_cgmanager - Error creating cgroup
> > hugetlb:testx
> >
> > I have tried the cgm commands, as a different user since the user which
> > needs to run lxc dont have sudo access. Following are the output
> > -- ranjib at agent01:~ $ sudo cgm create all go
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> >    int32 1
> >
> > -- ranjib at agent01:~ $ sudo cgm chown all go 111 117
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
> > method return sender=(null sender) -> dest=(null destination)
> reply_serial=1
>
> Once you've done this it's easier to just do cgm movepid as
> the 'go' user from the shell, i.e.
>
> cgm movepid all go $$
>
> > -- ranjib at agent01:~ $ sudo cgm movepid all go 18764
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> >
> >
> > Clearly the last one is failing, but im not sure why. I have installed
> > libpam-systemd and reboot the server, without any effect. Also i dont
> know
> > if the previous two cgm calls were successful, but their exit code was 0.
> >
> >
> > any help?
>
> Edit /etc/default/cgmanager and set 'cgmanager_opts="--debug"' there.  Try
> again, and then look at /var/log/upstart/cgmanager.log for info on what
> happened.
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150105/3a0e3373/attachment-0001.html>


More information about the lxc-users mailing list