← Back to team overview

touch-packages team mailing list archive

[Bug 1459751] Re: lxc-attach runs in wrong container directory

 

Interestingly, while the programmatic attach (in the API) supports a
initial_cwd argument, the lxc-attach program does not.

The current logic is - if inital_cwd is specified, it is used.  Otherwise,
you are placed in your current directory if it exists, else container root.

It probably would be best to have lxc-attach place you in the user's
homedir on login, although it may be hard to make such a change now
without upsetting existing scripts.


** Changed in: lxc (Ubuntu)
       Status: New => Confirmed

** Changed in: lxc (Ubuntu)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1459751

Title:
  lxc-attach runs in wrong container directory

Status in lxc package in Ubuntu:
  Confirmed

Bug description:
  net8-rmt# lxc-attach -n test -- bash -c 'id && egrep ^root /etc/passwd && echo ~ && echo $HOME && pwd'
  uid=0(root) gid=0(root) groups=0(root)
  root:x:0:0:root:/root:/bin/bash
  /root
  /root
  /

  Notice pwd show / instead of /root which is incorrect + causes all
  manner of confusion when debugging path related problems.

  net8-rmt# uname -a
  Linux ns515383.ip-167-114-159.net 3.19.0-18-generic #18-Ubuntu SMP Tue May 19 18:31:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

  net8-rmt# lsb_release -a
  No LSB modules are available.
  Distributor ID:	Ubuntu
  Description:	Ubuntu 15.04
  Release:	15.04
  Codename:	vivid

  Same behavior with containers created with precise through wily
  releases.

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


References