1. 26 May, 2015 7 commits
  2. 25 May, 2015 5 commits
  3. 23 May, 2015 1 commit
  4. 17 May, 2015 1 commit
  5. 15 May, 2015 1 commit
  6. 14 May, 2015 3 commits
    • Merge pull request #523 from lucaswerkmeister/fix521 · 8ec0243d
      Stéphane Graber authored
      Use POSIX-compliant function names in bash completion
    • Use POSIX-compliant function names in bash completion · e0bc1067
      Lucas Werkmeister authored
      When running in posix mode (for example, because it was invoked as `sh`,
      or with the --posix option), bash rejects the function names previously
      used because they contain hyphens, which are not legal POSIX names, and
      exits immediately.
      
      This is a particularly serious problem on a system in which the
      following three conditions hold:
      
      1. The `sh` executable is provided by bash, e. g. via a symlink
      2. Gnome Display Manager is used to launch X sessions
      3. Bash completion is loaded in the (system or user) profile file
         instead of in the bashrc file
      
      In that case, GDM's Xsession script (run with `sh`, i. e., bash in posix
      mode) sources the profile files, thus causing the shell to load the bash
      completion files. Upon encountering the non-POSIX-compliant function
      names, bash would then exit, immediately ending the X session.
      
      Fixes #521.
      Signed-off-by: 's avatarLucas Werkmeister <mail@lucaswerkmeister.de>
    • config : add lxc.hook.destroy option · 37cf711b
      Sungbae Yoo authored
      Signed-off-by: 's avatarSungbae Yoo <sungbae.yoo@samsung.com>
  7. 12 May, 2015 1 commit
  8. 11 May, 2015 5 commits
  9. 07 May, 2015 2 commits
  10. 04 May, 2015 4 commits
  11. 28 Apr, 2015 3 commits
  12. 26 Apr, 2015 1 commit
  13. 25 Apr, 2015 2 commits
  14. 24 Apr, 2015 2 commits
  15. 22 Apr, 2015 2 commits
    • use poll instead of select · 2366b8a7
      Serge Hallyn authored
      Particularly when using the go-lxc api with lots of threads, it
      happens that if the open files limit is > 1024, we will try to
      select on fd > 1024 which breaks on glibc.
      
      So use poll instead of select.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • logs: introduce a thread-local 'current' lxc_config (v2) · 858377e4
      Serge Hallyn authored
      The logging code uses a global log_fd and log_level to direct
      logging (ERROR(), etc).  While the container configuration file allows
      for lxc.loglevel and lxc.logfile, those are only used at configuration
      file read time to set the global variables.  This works ok in the
      lxc front-end programs, but becomes a problem with threaded API users.
      
      The simplest solution would be to not allow per-container configuration
      files, but it'd be nice to avoid that.
      
      Passing a logfd or lxc_conf into every ERROR/INFO/etc call is "possible",
      but would be a huge complication as there are many functions, including
      struct member functions and callbacks, which don't have that info and
      would need to get it from somewhere.
      
      So the approach I'm taking here is to say that all real container work
      is done inside api calls, and therefore the API calls themselves can
      set a thread-local variable indicating which log info to use.  If
      unset, then use the global values.  The lxc-* programs, when called
      with a '-o logfile' argument, set a global variable to indicate that
      the user-specified value should be used.
      
      In this patch:
      
      If the lxc container configuration specifies a loglevel/logfile, only
      set the lxc_config's logfd and loglevel according to those, not the
      global values.
      
      Each API call is wrapped to set/unset the current_config.  (The few
      exceptions are calls which do not result in any log actions)
      
      Update logfile appender to use the logfile specified in lxc_conf if (a)
      current_config is set and (b) the lxc-* command did not override it.
      
      Changelog (2015-04-21):
      	. always re-set current_config to NULL at end of an API
      	  call, rather than storing the previous value.  We don't
      	  nest API calls.
      	. remove the log_lock stuff which wasn't used
      	. lxc_conf_free: if the config is current_config, set
      	  current_config to NULL.  (It can't be another thread's
      	  current_config, or we wouldn't be freeing it)
      	. lxc_check_inherited: don't close fd if it is the
      	  current_config->logfd.  Note this is only called when
      	  starting a container, so we have no other threads at
      	  this point.
      
      Changelog (2015-04-22)
      	. Unset the per-container logfd on destroy
      	.
      	. Do so before we rm the containerdir.  Otherwise if the logfile is set
      	. to $lxcpath/$name/log, the containerdir won't be fully deleted.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>