[lxc-devel] [lxc/lxc] c43e97: Update Japanese lxc-create(1) for 'best' option

GitHub noreply at github.com
Fri Mar 21 19:04:01 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: c43e979d66e6eb7ec5d01b7b417a78272d46bc09
      https://github.com/lxc/lxc/commit/c43e979d66e6eb7ec5d01b7b417a78272d46bc09
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-03-21 (Fri, 21 Mar 2014)

  Changed paths:
    M doc/ja/lxc-create.sgml.in

  Log Message:
  -----------
  Update Japanese lxc-create(1) for 'best' option

Update for commit a526a632e007c0d666dbe953cf7b39fbf26b63db

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 0d9acb997fcb22ca6493535fd53ef0c4ee5bd156
      https://github.com/lxc/lxc/commit/0d9acb997fcb22ca6493535fd53ef0c4ee5bd156
  Author: Dwight Engen <dwight.engen at oracle.com>
  Date:   2014-03-21 (Fri, 21 Mar 2014)

  Changed paths:
    M src/lxc/console.c
    M src/lxc/console.h
    M src/lxc/lxc_console.c
    M src/lxc/lxc_start.c
    M src/lxc/start.c

  Log Message:
  -----------
  fix console stdin,stdout,stderr fds

The fds for stdin,stdout,stderr that we were leaving open for /sbin/init
in the container were those from /dev/tty or lxc.console (if given), which
wasn't right. Inside the container it should only have access to the pty
that lxc creates representing the console.

This was noticed because busybox's init was resetting the termio on its
stdin which was effecting the actual users terminal instead of the pty.
This meant it was setting icanon so were were not passing keystrokes
immediately to the pty, and hence command line history/editing wasn't
working.

Fix by dup'ing the console pty to stdin,stdout,stderr just before
exec()ing /sbin/init. Fix fd leak in error handling that I noticed while
going through this code.

Also tested with lxc.console = none, lxc.console = /dev/tty7 and no
lxc.console specified.

V2: The first version was getting EBADF sometimes on dup2() because
lxc_console_set_stdfds() was being called after lxc_check_inherited()
had already closed the fds for the pty. Fix by calling
lxc_check_inherited() as late as possible which also extends coverage
of open fd checked code.

V3: Don't move lxc_check_inherited() since it needs to be called while
the tmp proc mount is still mounted. Move call to lxc_console_set_stdfds()
just before it.

Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/79bff4f8862e...0d9acb997fcb


More information about the lxc-devel mailing list