Skip to content

Commit

Permalink
Setting lxc.console = none causes startup failures for the containers…
Browse files Browse the repository at this point in the history
… that runs in user namespace

Setting "lxc.console = none" causes following failure during startup

      lxc-start 1389039861.061 INFO     lxc_start_ui - using rcfile lxcpath/original/config
      lxc-start 1389039861.062 INFO     lxc_confile - read uid map: type u nsid 0 hostid 260000 range 10000
      lxc-start 1389039861.062 INFO     lxc_confile - read uid map: type g nsid 0 hostid 260000 range 10000
      lxc-start 1389039861.062 WARN     lxc_log - lxc_log_init called with log already initialized
      lxc-start 1389039861.065 INFO     lxc_lsm - LSM security driver AppArmor
      lxc-start 1389039861.066 DEBUG    lxc_conf - allocated pty '/dev/pts/0' (5/6)
      lxc-start 1389039861.066 DEBUG    lxc_conf - allocated pty '/dev/pts/7' (7/8)
      lxc-start 1389039861.066 DEBUG    lxc_conf - allocated pty '/dev/pts/8' (9/10)
      lxc-start 1389039861.066 DEBUG    lxc_conf - allocated pty '/dev/pts/9' (11/12)
      lxc-start 1389039861.066 INFO     lxc_conf - tty's configured
      lxc-start 1389039861.066 DEBUG    lxc_start - sigchild handler set
      lxc-start 1389039861.066 ERROR    lxc_conf - Error chowning
      lxc-start 1389039861.066 ERROR    lxc_conf - Failed to chown
      lxc-start 1389039861.066 ERROR    lxc_start - Failed to shift tty into container
      lxc-start 1389039861.066 ERROR    lxc_start - failed to initialize the container
      lxc-start 1389039861.067 INFO     lxc_monitor - using monitor sock name lxc/0863ffed81827105/lxcpath

fix it by checking the console.name before using it.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
caglar10ur authored and hallyn committed Jan 7, 2014
1 parent 65b8ba1 commit 29b10e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/conf.c
Expand Up @@ -3368,7 +3368,7 @@ int ttys_shift_ids(struct lxc_conf *c)
}
}

if (chown_mapped_root(c->console.name, c) < 0) {
if (strcmp(c->console.name, "") !=0 && chown_mapped_root(c->console.name, c) < 0) {
ERROR("Failed to chown %s", c->console.name);
return -1;
}
Expand Down

1 comment on commit 29b10e4

@nomadlena
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for fixing this bug. I have a small question. I've downloaded your file to my Linux with "wget https://github.com/lxc/lxc/commit/29b10e4f4755fc4e819187771e58b907daab5476.patch", how can I apply this to my system? What commands I should use and in what directory should I run these commands!! Thanks a lot!!

Please sign in to comment.