[lxc-devel] [PATCH] lxc-busybox: follow symlinks when inspecting busybox binary

2014-03-24 Thread Bogdan Purcareata
Signed-off-by: Bogdan Purcareata bogdan.purcare...@freescale.com
---
 templates/lxc-busybox.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index e5a512a..246e743 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -187,7 +187,7 @@ configure_busybox()
 return 1
 fi
 
-file $(which busybox) | grep -q statically linked
+file -L $(which busybox) | grep -q statically linked
 if [ $? -ne 0 ]; then
 echo warning : busybox is not statically linked.
 echo warning : The template script may not correctly
-- 
1.9.rc1


___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH RFC] log: introduce container logging

2014-03-24 Thread S . Çağlar Onur
On Fri, Mar 21, 2014 at 4:54 PM, Serge Hallyn serge.hal...@ubuntu.com wrote:
 Quoting S.Çağlar Onur (cag...@10ur.org):
 Hi Serge,

 On Wed, Mar 12, 2014 at 11:02 AM, Serge Hallyn serge.hal...@ubuntu.com 
 wrote:
  Quoting S.Çağlar Onur (cag...@10ur.org):
  Hi Serge,
 
  On Tue, Mar 11, 2014 at 8:13 PM, Serge Hallyn serge.hal...@ubuntu.com 
  wrote:
   This is not intended to be applied yet.
  
   This patch adds real per-container, thread-safe log preferences.  
   Currently
   if a program loads two containers which both set a lxc.logfile, and 
   start
   then start them in sequence, the logfile for the second container will 
   be
   used.  This patch stores the log preferences in the lxc_container 
   itself.
   It leaves ERROR/INFO/etc as global log print helpers, while the new
   CERROR/CINFO/etc become new per-container helpers.  To demonstrate how 
   to
   use these, some logging in lxcapi_start and lxcapi_create has been
   converted.
  
   What this patch ignores, and why I say this patch is not ready to be
   applied, is what to do about 'lxc-start -l info -o outfile'.  With this
   patch, global logging (ERROR) will go to outfile, while per-container
   logging will not.
 
  Wow, I didn't see that coming as I was thinking you were joking the
  other day :) One possible solution to this global v.s per-container
  logging problem could be using a well known global log file and
  introducing a new argument to override it.
 
  We could say that LXC_LOGPATH/lxc.log will have the global logs and
  logfile parameter will have the per-container logs. I guess the
  downside of this approach would be looking 2 different log files in 2
  different locations in case of a failure.
 
  Do you think we have lots of code that does something before we create
  an lxc_container struct? I could be wrong but I suspect we don't have
  much in as we almost have the lxc_container around all the time. So
  maybe we can make everything per-container level.
 
  My thought was that anything relating to the starting, stopping,
  running, or lxc-monitor for a container would go to the per-container
  log.  If things break while constructing the lxc_container, i.e. we
  can't read the config file, that goes to the global log.  You might
  be right that it is best to always use LXC_LOGPATH/lxc.log for the
  global log, or maybe even just LXCPATH/lxc.log, to minimize the
  amount of looking around we have to do when something fails.
 
  There is a practical problem.  We have lots of helper functions
  which don't get a lxc_container passed to them.  Some don't even
  get an lxc_conf.  Three obvious ways to fix that would be
 
  1. always pass a lxc_container * everywhere.  Don't like that.

 I've been thinking about this and I believe I reached a point where
 this option starts to make sense to me :)

 Most of those helper functions are not generic, they are doing
 something on behalf of the container (or as a part of container setup
 process). I know this will be a very bad example but most of them
 could have been a method of a Container class if we were using C++ (as
 they might logically fit into that encapsulation). And based on this
 (flawed?) idea, I think I started to like passing container struct
 around way.

 Ok, I appreciate your input.  Do you have time to start a trial
 patch for this approach?  If not I'll give it a shot when I get
 time.

Nowadays I'm having little bit trouble finding some free time :/ I'll
see what I can do but don't count on me for the next 1 or 2 weeks :)

 ___
 lxc-devel mailing list
 lxc-devel@lists.linuxcontainers.org
 http://lists.linuxcontainers.org/listinfo/lxc-devel

Cheers,
-- 
S.Çağlar Onur cag...@10ur.org
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH] lxc-ls: Optimize things a bit

2014-03-24 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com):
 Don't bother access information that the user didn't request.
 
 Signed-off-by: Stéphane Graber stgra...@ubuntu.com

Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com

 ---
  src/lxc/lxc-ls.in | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
 index 7e35ab2..4665314 100755
 --- a/src/lxc/lxc-ls.in
 +++ b/src/lxc/lxc-ls.in
 @@ -244,17 +244,17 @@ def get_containers(fd=None, base=/, root=False):
  continue
  
  # Some extra field we may want
 -if 'state' in args.fancy_format or args.nesting:
 +if 'state' in args.fancy_format:
  entry['state'] = state
  
 -if 'pid' in args.fancy_format or args.nesting:
 +if 'pid' in args.fancy_format:
  entry['pid'] = -
  if state == 'UNKNOWN':
  entry['pid'] = state
  elif container.init_pid != -1:
  entry['pid'] = str(container.init_pid)
  
 -if 'autostart' in args.fancy_format or args.nesting:
 +if 'autostart' in args.fancy_format:
  entry['autostart'] = NO
  try:
  if container.get_config_item(lxc.start.auto) == 1:
 @@ -307,7 +307,7 @@ def get_containers(fd=None, base=/, root=False):
  
  # Get the IPs
  for family, protocol in {'inet': 'ipv4', 'inet6': 
 'ipv6'}.items():
 -if protocol in args.fancy_format or args.nesting:
 +if protocol in args.fancy_format:
  entry[protocol] = -
  
  if state == 'UNKNOWN':
 -- 
 1.9.1
 
 ___
 lxc-devel mailing list
 lxc-devel@lists.linuxcontainers.org
 http://lists.linuxcontainers.org/listinfo/lxc-devel
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH] lxc-busybox: follow symlinks when inspecting busybox binary

2014-03-24 Thread Serge Hallyn
Quoting Bogdan Purcareata (bogdan.purcare...@freescale.com):
 Signed-off-by: Bogdan Purcareata bogdan.purcare...@freescale.com

Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com

 ---
  templates/lxc-busybox.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
 index e5a512a..246e743 100644
 --- a/templates/lxc-busybox.in
 +++ b/templates/lxc-busybox.in
 @@ -187,7 +187,7 @@ configure_busybox()
  return 1
  fi
  
 -file $(which busybox) | grep -q statically linked
 +file -L $(which busybox) | grep -q statically linked
  if [ $? -ne 0 ]; then
  echo warning : busybox is not statically linked.
  echo warning : The template script may not correctly
 -- 
 1.9.rc1
 
 
 ___
 lxc-devel mailing list
 lxc-devel@lists.linuxcontainers.org
 http://lists.linuxcontainers.org/listinfo/lxc-devel
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/lxc] 50dbb8: lxc-busybox: follow symlinks when inspecting busyb...

2014-03-24 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 50dbb8209bf65e4d24ccd06d3ca05004d0ddc63c
  https://github.com/lxc/lxc/commit/50dbb8209bf65e4d24ccd06d3ca05004d0ddc63c
  Author: Bogdan Purcareata bogdan.purcare...@freescale.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M templates/lxc-busybox.in

  Log Message:
  ---
  lxc-busybox: follow symlinks when inspecting busybox binary

Signed-off-by: Bogdan Purcareata bogdan.purcare...@freescale.com
Signed-off-by: Serge Hallyn serge.hal...@ubuntu.com


___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH] criu: Add exec-cmd option (v3)

2014-03-24 Thread Pavel Emelyanov
On 03/22/2014 08:14 PM, Deyan Doychev wrote:
 
 Signed-off-by: Deyan Doychev deyandoic...@gmail.com

Applied, thanks a lot!

Deyan, it would also be great if you provide a test for the --exec-cmd option
so that we could include it in the daily jenkins run to make sure that the
functionality doesn't get accidentally broken.

And we're looking forward to the fixes to LXC that make use of the option :)

Thanks,
Pavel
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH] criu: Add exec-cmd option (v3)

2014-03-24 Thread Pavel Emelyanov
On 03/25/2014 01:42 AM, Marian Marinov wrote:
 On 03/24/2014 11:23 PM, Pavel Emelyanov wrote:
 On 03/22/2014 08:14 PM, Deyan Doychev wrote:

 Signed-off-by: Deyan Doychev deyandoic...@gmail.com

 Applied, thanks a lot!

 Deyan, it would also be great if you provide a test for the --exec-cmd option
 so that we could include it in the daily jenkins run to make sure that the
 functionality doesn't get accidentally broken.

 And we're looking forward to the fixes to LXC that make use of the option :)
 
 Hi Pavel,
 I work with Deyan on these changes. We need to get something working first 
 and then we will add tests and polish our 
 patches.
 
 For now the main task will be to create the daemon that will be used for the 
 restored container.
 Once we have a working version, we will separate the changes into individual 
 patches and work with you guys to push them 
 to the project.

Cool! By the way, it looks like we'll have additional testing on this by Adrian 
-- he 
requires similar functionality to restore the open-mpi task.

 If you are interested in our hacky version of the daemon, once its ready and 
 working we can also share that with you and 
 based on that code to decide how to implement it better in both LXC and CRIU.

Yes, if you could share even the preliminary version of this, that would be 
awesome.
Andrew (avagin@ in Cc) is working on making LXC container be migrate-able with 
the
p.haul, so having something to play with would really help.

 Best regards,
 Marian

Thanks,
Pavel
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


Re: [lxc-devel] [PATCH] criu: Add exec-cmd option (v3)

2014-03-24 Thread Marian Marinov

On 03/24/2014 11:23 PM, Pavel Emelyanov wrote:

On 03/22/2014 08:14 PM, Deyan Doychev wrote:


Signed-off-by: Deyan Doychev deyandoic...@gmail.com


Applied, thanks a lot!

Deyan, it would also be great if you provide a test for the --exec-cmd option
so that we could include it in the daily jenkins run to make sure that the
functionality doesn't get accidentally broken.

And we're looking forward to the fixes to LXC that make use of the option :)


Hi Pavel,
I work with Deyan on these changes. We need to get something working first and then we will add tests and polish our 
patches.


For now the main task will be to create the daemon that will be used for the 
restored container.
Once we have a working version, we will separate the changes into individual patches and work with you guys to push them 
to the project.


If you are interested in our hacky version of the daemon, once its ready and working we can also share that with you and 
based on that code to decide how to implement it better in both LXC and CRIU.


Best regards,
Marian



Thanks,
Pavel
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel




___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/lxc] fe9baa: lxc-ls: Fix memory reporting

2014-03-24 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: fe9baa4c87e0ad2c445056119d9e7a81b47f6203
  https://github.com/lxc/lxc/commit/fe9baa4c87e0ad2c445056119d9e7a81b47f6203
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M src/lxc/lxc-ls.in

  Log Message:
  ---
  lxc-ls: Fix memory reporting

This resolves the memory math when memsw is enabled and fixes reporting
of nested containers memory when using cgmanager.

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


  Commit: 3f09d6d887223ad205161ae523d036ecb7f89640
  https://github.com/lxc/lxc/commit/3f09d6d887223ad205161ae523d036ecb7f89640
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M src/lxc/lxc-ls.in

  Log Message:
  ---
  lxc-ls: Optimize things a bit

Don't bother access information that the user didn't request.

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


  Commit: 70084daff6b4e75608ccb780423f43be28cbed6a
  https://github.com/lxc/lxc/commit/70084daff6b4e75608ccb780423f43be28cbed6a
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M config/templates/centos.userns.conf.in
M config/templates/debian.userns.conf.in
M config/templates/fedora.userns.conf.in
M config/templates/gentoo.userns.conf.in
M config/templates/oracle.userns.conf.in
M config/templates/plamo.userns.conf.in
M config/templates/ubuntu.userns.conf.in

  Log Message:
  ---
  userns: Update bind-mounted devices

This updates all configs to include the exact same set of 7 bind-mounted
devices:
 - console
 - full
 - null
 - random
 - tty
 - urandom
 - zero

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


Compare: https://github.com/lxc/lxc/compare/50dbb8209bf6...70084daff6b4___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/lxc] 04612e: lxc-busybox: follow symlinks when inspecting busyb...

2014-03-24 Thread GitHub
  Branch: refs/heads/stable-1.0
  Home:   https://github.com/lxc/lxc
  Commit: 04612e3308911e4ff29939fa936685bfeca60041
  https://github.com/lxc/lxc/commit/04612e3308911e4ff29939fa936685bfeca60041
  Author: Bogdan Purcareata bogdan.purcare...@freescale.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M templates/lxc-busybox.in

  Log Message:
  ---
  lxc-busybox: follow symlinks when inspecting busybox binary

Signed-off-by: Bogdan Purcareata bogdan.purcare...@freescale.com
Signed-off-by: Serge Hallyn serge.hal...@ubuntu.com


  Commit: 869d48f4570457f3d3fcfbd6d1c134330d34b6f5
  https://github.com/lxc/lxc/commit/869d48f4570457f3d3fcfbd6d1c134330d34b6f5
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M src/lxc/lxc-ls.in

  Log Message:
  ---
  lxc-ls: Fix memory reporting

This resolves the memory math when memsw is enabled and fixes reporting
of nested containers memory when using cgmanager.

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


  Commit: 50df4a62a25fd1d75d35b3dfc0fcff4ad53e9e00
  https://github.com/lxc/lxc/commit/50df4a62a25fd1d75d35b3dfc0fcff4ad53e9e00
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M src/lxc/lxc-ls.in

  Log Message:
  ---
  lxc-ls: Optimize things a bit

Don't bother access information that the user didn't request.

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


  Commit: eae105f13cd30f7be336bc1d9699cfa4e3e532d9
  https://github.com/lxc/lxc/commit/eae105f13cd30f7be336bc1d9699cfa4e3e532d9
  Author: Stéphane Graber stgra...@ubuntu.com
  Date:   2014-03-24 (Mon, 24 Mar 2014)

  Changed paths:
M config/templates/centos.userns.conf.in
M config/templates/debian.userns.conf.in
M config/templates/fedora.userns.conf.in
M config/templates/gentoo.userns.conf.in
M config/templates/oracle.userns.conf.in
M config/templates/plamo.userns.conf.in
M config/templates/ubuntu.userns.conf.in

  Log Message:
  ---
  userns: Update bind-mounted devices

This updates all configs to include the exact same set of 7 bind-mounted
devices:
 - console
 - full
 - null
 - random
 - tty
 - urandom
 - zero

Signed-off-by: Stéphane Graber stgra...@ubuntu.com
Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com


Compare: https://github.com/lxc/lxc/compare/33275cc41e96...eae105f13cd3___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel