1. 28 Jan, 2013 4 commits
    • add lua binding for the lxc API · f080ffd7
      Dwight Engen authored
      The lua binding is based closely on the python binding. Also included are
      a test program for excercising the binding, and an lxc-top utility for
      showing statistics on running containers.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • setup_mount_entries: ignore mount failure if 'optional' · 68c152ef
      Serge Hallyn authored
      If 'optional' is in the mount options, then avoid failure in
      mount().
      
      Experiments suggest we could just do this checking data at
      mount_entry(), but that feels less proper than using
      hasmntopt() against the mntent.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • use a default per-container logfile · 5e1e7aaf
      Serge Hallyn authored
      Until now, if a lxc-* (i.e. lxc-start) command did not specify a logfile
      (with -o logfile), the default was effectively 'none'.  With this patch,
      the default becomes a per-container log file.
      
      If a container config file specifies 'lxc.logfile', that will override
      the default.  If a '-o logfile' argument is specifed at lxc-start,
      then that will override both the default and the configuration file
      entry.  Finally, '-o none' can be used to avoid having a logfile at
      all (in other words, the previous default), and that will override
      a lxc.logfile entry in the container configuration file.
      
      If the user does not have rights to open the default, then 'none' will
      be used.  However, in that case an error will show up on console.  (We
      can work on removing that if it annoys people, but I think it is
      helpful, at least while we're still ironing this set out)  If the user
      or container configuration file specified a logfile, and the user does
      not have rights to open the default, then the action will fail.
      
      One slight "mis-behavior" which I have not fixed (and may not fix) is
      that if a lxc.logfile is specified, the default logfile will still
      get created before we read the configuration file to find out there
      is a lxc.logfile entry.
      
      changelog:  Jan 24:
      
       add --enable-configpath-log configure option
      
       When we log to /var/lib/lxc/$container/$container.log, several things
       need to be done differently than when we log into /var/log/lxc (for
       instance).  So give it a configure option so we know what to do
      
       When the user specifies a logfile, we bail if we can't open it.  But
       when opening the default logfile, the user may not have rights to
       open it, so in that case ignore it and continue as if using 'none'.
      
       When using /var/lib/lxc/$c/$c.log, we use $LOGPATH/$name/$name.log.
       Otherwise, we use $LOGPATH/$name.log.
      
       When using /var/lib/lxc/$c/$c.log, don't try to create the log path
       /var/lib/lxc/$c.  It can only not exist if the container doesn't
       exist.  We don't want to create the directory in that case.  When
       using /var/log/lxc, then we do want to create the path if it does
       not exist.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • oracle template: fix sudo lxc-create on ubuntu · 1ff8a460
      Dwight Engen authored
      rpm on ubuntu puts the rpm db under $HOME, which wont be /root if
      sudo is used
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
  2. 23 Jan, 2013 3 commits
  3. 22 Jan, 2013 4 commits
  4. 21 Jan, 2013 1 commit
  5. 15 Jan, 2013 7 commits
  6. 14 Jan, 2013 2 commits
    • MAKEDEV call, add autodev hooks, add environment variables for hook scripts. · f7bee6c6
      Michael H. Warfield authored
      Ok...  Here's the patch again.  Since Serge is removing the loglevel
      structure member, this patch no longer references that element.
      
      From the original description:
      
      1) Removes run_makedev() and the call to it from conf.c per discussion.
      
      2) Adds an lxc.hook.autodev hook.
      
      Note: This hook is very close (one routine level abstracted) from where
      the run_makedev was called.  Anyone really rrreeeaaalllyyy needing
      MAKEDEV can add it in with a small shim script to do whatever they want
      under whatever distro they're using, so no functionality is lost there.
      
      3) Added a number of environment variables for all the hook scripts to
      reference to assist in execution.  Things like LXC_ROOTFS_MOUNT could be
      very useful but others were added as well.  Room for more if anyone has
      an itch.  All in one spot in lxc_start.c.
      
      4) clearenv and putenv( "container=lxc" ) calls were moved to just after
      the "start" hook in the container just prior to actually firing up the
      container so we could use environment variables prior to that and have
      them flushed them before firing up init.  Nice side effect is that you
      can define environment variables and then call lxc-start and have them
      show up in those hooks scripts.
      
      5) I actually DID update the man page for lxc.conf!  I guess I lied when
      I said I wouldn't get that done.
      
      [... and ...]
      
      I added the rcfile to the lxc_conf structure as suggested and moved the
      setenv bundle from lxc-start.c over to start.c just prior to calling
      run_lxc_hooks for the pre-start hook.
      Signed-off-by: 's avatarMichael H. Warfield <mhw@WittsEnd.com>
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
    • remove logfile and loglevel from struct lxc_conf · 9ea87d5d
      Serge Hallyn authored
      The options are still supported in the lxc configuration file.
      However they are stored only in local variables in src/lxc/log.c,
      which can be read using two new functions:
      	int lxc_log_get_level(void);
      	const char *lxc_log_get_file(void);
      
      Changelog: jan 14:
       have lxc_log_init use lxc_log_set_file(), have lxc_log_set_file() take
       a const char *, and have it keep its own strdup'd copy of the filename.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
  7. 13 Jan, 2013 1 commit
  8. 11 Jan, 2013 7 commits
  9. 10 Jan, 2013 2 commits
  10. 09 Jan, 2013 9 commits