[lxc-devel] -L option with lxc-start

Michael H. Warfield mhw at WittsEnd.com
Sun May 25 01:08:43 UTC 2014


On Sat, 2014-05-24 at 22:15 +0000, Serge Hallyn wrote:
> Quoting William Dauchy (wdauchy at gmail.com):
> > Hello,
> > 
> > lxc1 did a modification in the lxc.console behaviour (compared to the
> > previous version)
> > Indeed, in the config file lxc.console now accept a tty and not a file.
> > I now need to use -L with lxc-start to get logs in a file.
> > 
> > The problem raised is now I don't have a -L equivalent in config like
> > before. Correct me if I'm wrong.
> > 
> > lxc.console in config file:
> > % git grep -F console.path
> > lxc/conf.c:     new->console.path = NULL;
> > lxc/conf.c:     if (conf->console.path)
> > lxc/conf.c:             free(conf->console.path);
> > lxc/confile.c:  return config_path_item(&lxc_conf->console.path, value);
> > lxc/confile.c:          v = c->console.path;
> > lxc/confile.c:  if (c->console.path)
> > lxc/confile.c:          fprintf(fout, "lxc.console = %s\n", c->console.path);
> > lxc/lxc_start.c:        if (ensure_path(&conf->console.path,
> > my_args.console) < 0) {
> > lxc/start.c:    if (conf->console.path && setenv("LXC_CONSOLE",
> > conf->console.path, 1)) {
> > 
> > -L with lxc-start, no equivalent in config file:
> > % git grep -F console.log_path
> > lxc/conf.c:     new->console.log_path = NULL;
> > lxc/lxc_start.c:        if (ensure_path(&conf->console.log_path,
> > my_args.console_log) < 0) {
> > lxc/start.c:    if (conf->console.log_path &&
> > setenv("LXC_CONSOLE_LOGPATH", conf->console.log_path, 1)) {
> 
> Indeed, it looks like we need a patch to confile.c to add a
> config_console_logfile() helper to set that.  Would you be
> interested in writing that patch?

Wait a second.  I recall something along these lines being discussed
years ago and, iirc, you pointed out to us that there's a chicken and
egg situation in there that there are logging calls in the options
parsing and processing and there was some problem with switching log
file mid-stream or initializing or stuff.  Seems like I remember those
log files and consoles being sensitive to when they were initialized...

We may want to be very careful there.

Regards,
Mike

-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140524/7b8566e4/attachment.sig>


More information about the lxc-devel mailing list