1. 22 Jan, 2013 3 commits
    • use a default per-container logfile · 74476cf1
      Serge Hallyn authored
      [ Thanks to Stéphane and Dwight for the feedback on the previous patch ]
      
      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 $LOGPATH/<container>/<container>.log.  LOGPATH is
      specified at configure time with '--with-log-path='.  If unspecified, it
      is $LXCPATH, so that logs for container r2 will show up at
      /var/lib/lxc/r2/r2/log.  LOGPATH must exist, while lxc will make sure to
      create $LOGPATH/<name>.  As another example, Ubuntu will likely specify
      --with-log-path=/var/log/lxc (and place /var/log/lxc into
      debian/lxc.dirs), placing r2's logs in /var/log/lxc/r2/r2.log.
      
      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.
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • lxc-setcap.in: Set path to lxc-init · 81b2d972
      Matthias Brugger authored
      In lxc-setcap the path to lxc-init wasn't set right, so that
      a call to the script failed with an error. This patch sets
      the path to the right directory.
      Signed-off-by: 's avatarMatthias Brugger <matthias.bgg@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • use which instead of type · 169bf5e0
      Dwight Engen authored
      This is for consistency with the rest of lxc, and also because type checks for
      shell builtins, a behavior that we do not want in these cases. Ensure stderr
      for which is redirected to /dev/null also.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
  2. 21 Jan, 2013 1 commit
  3. 15 Jan, 2013 7 commits
  4. 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>
  5. 13 Jan, 2013 1 commit
  6. 11 Jan, 2013 7 commits
  7. 10 Jan, 2013 2 commits
  8. 09 Jan, 2013 17 commits