Re: [lxc-devel] Rethinking lxc-info a bit

2013-11-15 Thread Natanael Copa
On Wed, 13 Nov 2013 14:41:55 -0500 Stéphane Graber wrote: > So my suggestion for lxc-info in LXC 1.0 are: > - Only support one container and make -n mandatory, fail with an error >if the container can't be found. I like the idea of lxc-info operating on a single container and have other too

[lxc-devel] [PATCH 1/2] lxc-alpine: run bootmisc and syslog at boot runlevel

2013-10-24 Thread Natanael Copa
The bootmisc script is needed to clean up various temp dirs like /tmp and migrate /var/run to /run if needed. The syslog service is started in 'boot' runlevel when running on real hardware so we do the same for containers. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in

[lxc-devel] [PATCH 2/2] lxc-alpine: enable 4 consoles by default

2013-10-24 Thread Natanael Copa
We allow 4 consoles in the LXC config file so we can enable 4 in the inittab as well. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 2756b89..258eed4 100644 --- a/templates

[lxc-devel] [PATCH] lxc-alpine: allow /dev/full

2013-10-22 Thread Natanael Copa
The template creates /dev/full for the container but needs also give permission to access it. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 5fdf36f..8600a34

Re: [lxc-devel] what happened to the autostart proposals?

2013-10-21 Thread Natanael Copa
On Sun, 20 Oct 2013 08:46:10 -0400 "Michael H. Warfield" wrote: > On Sun, 2013-10-20 at 12:21 +0200, Natanael Copa wrote: > > On Fri, 18 Oct 2013 15:17:22 -0400 > > Stéphane Graber wrote: > > > > > On Fri, Oct 18, 2013 at 08:26:53PM +0200, Harald D

Re: [lxc-devel] [lxc/lxc] 07520b: Update maintainers and URLs

2013-10-20 Thread Natanael Copa
On Sat, 19 Oct 2013 21:49:03 -0700 GitHub wrote: > Branch: refs/heads/master > Home: https://github.com/lxc/lxc > Commit: 07520b2af5495cbde94645d09b523de73047542d Would it be an idea to have a separate mailing list for git commits? I think the mailing list is painfully noisy. -nc -

Re: [lxc-devel] what happened to the autostart proposals?

2013-10-20 Thread Natanael Copa
On Fri, 18 Oct 2013 15:17:22 -0400 Stéphane Graber wrote: > On Fri, Oct 18, 2013 at 08:26:53PM +0200, Harald Dunkel wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > Hi folks, > > > > there were several proposals on this mailing list about how > > to start and stop a group

[lxc-devel] [PATCH] lxc-alpine: enable loopback interface by default

2013-10-16 Thread Natanael Copa
It was probably disabled by a mistake Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 05aec74..5fdf36f 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc

Re: [lxc-devel] [Lxc-users] Working LXC templates?

2013-09-09 Thread Natanael Copa
On Sun, 08 Sep 2013 20:33:16 -0400 "Michael H. Warfield" wrote: > With all due respect... > > On Sun, 2013-09-08 at 16:08 -0700, Tony Su wrote: > > After putting some thought into this, > > IMO LXC badly needs a universal tool with the following features > > > > - A single script should be use

[lxc-devel] [PATCH] configure: enable Lua if found and continue without if not

2013-09-06 Thread Natanael Copa
Search for Lua if no --enable-lua/--disable-lua specified but continue without if not found. If --enable-lua is specified and Lua is not found then return error. If --disable-lua is specified, then don't search for Lua. Signed-off-by: Natanael Copa --- configure.ac

Re: [lxc-devel] [PATCH] lua: fix logic to enable lua support in configure

2013-09-06 Thread Natanael Copa
On Fri, 6 Sep 2013 10:56:09 +0200 Thomas Moschny wrote: > 2013/9/6 Natanael Copa : > > I wonder it it would be an idea to replace the 2 switches: > > > > --enable-lua > > --with-lua-pc[=PKG] > > > > with a single switch: > > > > --wit

[lxc-devel] [PATCH] lua: fix logic to enable lua support in configure

2013-09-06 Thread Natanael Copa
When there is no --enable-lua or --with-lua-pc, Lua should not be enabled. This fixes a bug introduced with 12e93188 (configure/makefile: Allow specify Lua pkg-config file with --with-lua-pc) that caused configure script to fail if lua headers was missing. Signed-off-by: Natanael Copa --- PS

Re: [lxc-devel] [PATCH v2] configure/makefile: Allow specify Lua pkg-config file with --with-lua-pc

2013-09-05 Thread Natanael Copa
uld be enough to revert: commit 12e93188de7dfe9ba66e022f9c28aa1f696a22e8 Author: Natanael Copa Date: Thu Sep 5 17:13:07 2013 +0200 configure/makefile: Allow specify Lua pkg-config file with --with-lua-pc I will try fix it before you reach to do that though. > Sorry for not spo

[lxc-devel] [PATCH v2] configure/makefile: Allow specify Lua pkg-config file with --with-lua-pc

2013-09-05 Thread Natanael Copa
Enable support for both Lua 5.1 and 5.2 by let user specify the Lua pkg-config package name. By default it will use 'lua' and try figure out which version it is. Signed-off-by: Natanael Copa --- Changes v1 -> v2: - define PKG_CHECK_VAR which was introduced in pkg-config 0.28. Ub

Re: [lxc-devel] [PATCH] update lua binding to support both 5.2 and 5.1

2013-09-05 Thread Natanael Copa
On Thu, 5 Sep 2013 09:41:12 -0400 Dwight Engen wrote: > fix a bug in the parsing of /proc/mounts (from Natanael Copa > ) > > remove lxc subdir in cgroup paths > > remove extraneous debug printfs > > remove extra call to stats_clear > > Tested lxc-top, and apite

Re: [lxc-devel] [PATCH] lua: prepare for Lua 5.2

2013-09-05 Thread Natanael Copa
On Thu, 5 Sep 2013 09:34:14 -0400 Dwight Engen wrote: > On Thu, 5 Sep 2013 08:11:57 -0500 > Serge Hallyn wrote: > > > Hi Dwight, > > > > do you have time to review/ack these (3, so far) lua patches? > > > > (I probably don't know enough to do so) > > Yeah I've taken a look. I had already don

Re: [lxc-devel] [PATCH] lua: prepare for Lua 5.2

2013-09-05 Thread Natanael Copa
On Thu, 5 Sep 2013 08:11:57 -0500 Serge Hallyn wrote: > Hi Dwight, > > do you have time to review/ack these (3, so far) lua patches? I send 2 more patches, to get rid of fork/exec. (os.execute and io.popen) They should all be available from https://github.com/ncopa/lxc Thanks! -nc -

[lxc-devel] [PATCH] lua: implement dirname in C rather than depen on external executable

2013-09-05 Thread Natanael Copa
Instead of popen and run external executable dirname we implement a dirname in C in the core module. We also remove the unused basename function. Signed-off-by: Natanael Copa --- src/lua-lxc/core.c | 8 src/lua-lxc/lxc.lua | 18 +- 2 files changed, 9 insertions

[lxc-devel] [PATCH] lua: implement usleep in C module

2013-09-05 Thread Natanael Copa
So we avoid running os.execute Signed-off-by: Natanael Copa --- src/lua-lxc/core.c | 9 + src/lxc/lxc-top| 12 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/lua-lxc/core.c b/src/lua-lxc/core.c index d404707..504e147 100644 --- a/src/lua-lxc

[lxc-devel] [PATCH] configure/makefile: Allow specify Lua pkg-config file with --with-lua-pc

2013-09-05 Thread Natanael Copa
Enable support for both Lua 5.1 and 5.2 by let user specify the Lua pkg-config package name. By default it will use 'lua' and try figure out which version it is. Signed-off-by: Natanael Copa --- configure.ac| 36 +++- src/lua-lxc/Makefi

[lxc-devel] [PATCH] lua: prepare for Lua 5.2

2013-09-04 Thread Natanael Copa
Adjust code for Lua 5.2 and keep compatibility with Lua 5.1. We also fix a bug in the parsing of /proc/mounts while here. Signed-off-by: Natanael Copa --- src/lua-lxc/core.c | 10 -- src/lua-lxc/lxc.lua | 18 ++ 2 files changed, 22 insertions(+), 6 deletions(-) diff

[lxc-devel] [PATCH] lxc-alpine: add hwaddr for a single macvlan interface

2013-09-04 Thread Natanael Copa
We already add harware address for a single veth interface. Do the same with a single macvlan interface. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index

Re: [lxc-devel] [Lxc-users] Working LXC templates?

2013-09-04 Thread Natanael Copa
On Wed, 04 Sep 2013 09:40:49 -0400 "Michael H. Warfield" wrote: > I do think it is an issue with the whole "distribution agnostic > template" problem that may require some help from the distros or some > innovative ideas of how we can bootstrap distros using distro agnostic > tools (like stone k

[lxc-devel] [PATCH] lxc-alpine: create /dev/zero

2013-08-26 Thread Natanael Copa
Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index ce7226f..2ab10bb 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -126,6 +126,7 @@ EOF echo "Setti

[lxc-devel] [PATCH] lxc-alpine: make --release work when apk exists

2013-06-28 Thread Natanael Copa
Use sed to set the specified alpine release in the copied /etc/apk/repositories Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 4 1 file changed, 4 insertions(+) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 410c817..be2a535 100644 --- a/templates/lxc

Re: [lxc-devel] [PATCH 2/2] lxc-alpine: option for specifying the release to be installed

2013-06-26 Thread Natanael Copa
On Wed, 26 Jun 2013 11:15:00 +0300 Kaarle Ritvanen wrote: > Signed-off-by: Kaarle Ritvanen > --- > templates/lxc-alpine.in | 23 --- > 1 file changed, 16 insertions(+), 7 deletions(-) I tested with '--release v2.6' and '--relase edge'. It only work when apk is not found.

Re: [lxc-devel] [PATCH 1/2] lxc-alpine: automatic repository selection

2013-06-26 Thread Natanael Copa
On Wed, 26 Jun 2013 11:14:59 +0300 Kaarle Ritvanen wrote: > pick random server from mirror list > use the latest stable release > > Signed-off-by: Kaarle Ritvanen > --- > templates/lxc-alpine.in | 31 +-- > 1 file changed, 29 insertions(+), 2 deletions(-) ack -nc

[lxc-devel] [PATCH] lxc-init: continue even if we fail to mount /dev/mqueue

2013-06-12 Thread Natanael Copa
plications actually need /dev/mqueue. This similar to what we do with /dev/shm. Signed-off-by: Natanael Copa --- src/lxc/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 6c0f9d0..136f943 100644 --- a/src/lxc/utils.c +++ b/src/l

Re: [lxc-devel] [PATCH v2] lxc-alpine: download a static package manager if its missing

2013-06-03 Thread Natanael Copa
On Mon, 3 Jun 2013 08:57:11 -0500 Serge Hallyn wrote: > Quoting Natanael Copa (nc...@alpinelinux.org): > > On Wed, 29 May 2013 15:03:50 -0500 > > Serge Hallyn wrote: > > > > > Quoting Natanael Copa (nc...@alpinelinux.org): > > > > If the p

Re: [lxc-devel] Container autostart proposal V2

2013-06-03 Thread Natanael Copa
On Tue, 28 May 2013 17:36:09 -0400 Dwight Engen wrote: > On Tue, 28 May 2013 17:03:43 -0400 > Stéphane Graber wrote: ... > > The command line parameter (-g) is comma separate however. So commas > > should be documented as invalid for a group name and so is "any" which > > is a special group matc

Re: [lxc-devel] [PATCH v2] lxc-alpine: download a static package manager if its missing

2013-06-03 Thread Natanael Copa
On Wed, 29 May 2013 15:03:50 -0500 Serge Hallyn wrote: > Quoting Natanael Copa (nc...@alpinelinux.org): > > If the package manager, apk-tools is missing, then: > > - download a static binary and public keys > > - verify the keys against embedded checksum > > -

[lxc-devel] [PATCH v2] lxc-alpine: download a static package manager if its missing

2013-05-28 Thread Natanael Copa
If the package manager, apk-tools is missing, then: - download a static binary and public keys - verify the keys against embedded checksum - verify the signature of the static binary against the downloaded keys - use the verified static binary Signed-off-by: Natanael Copa Signed-off-by

Re: [lxc-devel] Container autostart proposal

2013-05-28 Thread Natanael Copa
On Mon, 27 May 2013 15:07:03 -0400 Stéphane Graber wrote: > Hello, > > One feature that distros have been hacking together on their side for a > while is container autostart. ... > So I therefore have two proposals on how to implement this, let me know > what you prefer: > 1) > - Keep things a

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-19 Thread Natanael Copa
On Sat, 18 May 2013 18:14:36 -0500 Serge Hallyn wrote: > > > I do see that for instance feeding a > > > tar file with malicious /bin/passwd, which templates later run > > > under a regular chroot, could be just as easy... > > > > I don't really understand what you mean with this... > > In the

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-18 Thread Natanael Copa
On Fri, 17 May 2013 12:04:01 -0400 "Michael H. Warfield" wrote: > On Fri, 2013-05-17 at 09:24 -0500, Serge Hallyn wrote: > > Quoting Kaarle Ritvanen (kaarle.ritva...@datakunkku.fi): > > > On Thu, 16 May 2013, Natanael Copa wrote: > > > > > > &g

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-18 Thread Natanael Copa
On Fri, 17 May 2013 11:32:34 -0500 Serge Hallyn wrote: > I'm not quite ready to send it (and have been derailed with wanting to > finish api conversion of a few commands, and other stuff next week), > but I do have a working patch introducing 'lxc-ubuntu-cloud-user' > template, which allows an u

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-18 Thread Natanael Copa
On Fri, 17 May 2013 09:24:51 -0500 Serge Hallyn wrote: > Quoting Kaarle Ritvanen (kaarle.ritva...@datakunkku.fi): > > On Thu, 16 May 2013, Natanael Copa wrote: > > > > >On Wed, 15 May 2013 13:10:06 -0500 > > >Serge Hallyn wrote: > > > &

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-16 Thread Natanael Copa
On Wed, 15 May 2013 13:10:06 -0500 Serge Hallyn wrote: > Quoting Kaarle Ritvanen (kaarle.ritva...@datakunkku.fi): > ... > > +wget="wget -O - $repository/x86" > .. > > +$wget/apk-tools-static-$apk_version.apk | \ > > +tar -Oxz sbin/apk.static > $apk || return 1 > > +

Re: [lxc-devel] [PATCH] lxc-alpine: download statically compiled package manager if not available on host

2013-05-14 Thread Natanael Copa
On Tue, 14 May 2013 19:27:32 +0300 Kaarle Ritvanen wrote: > Signed-off-by: Kaarle Ritvanen I have looked over it and tested it on Alpine Linux. It should make it very simple to test an Alpine Linux container on any x86/x86_64 GNU Linux. Acked-by: Natanael Copa > --- > temp

[lxc-devel] [PATCH] configure: replace deprecated AM_CONFIG_HEADER

2013-02-19 Thread Natanael Copa
Replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADER. This is needed for automake-1.13. Signed-off-by: Natanael Copa --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 931e0d6..c5c71e4 100644 --- a/configure.ac +++ b

Re: [lxc-devel] [PATCH] Link against pthread when not on bionic.

2013-02-19 Thread Natanael Copa
On Mon, 18 Feb 2013 12:23:24 -0500 Stéphane Graber wrote: > dpkg spotted that we're not explicitly linking against pthread even though > we use some of its symbols (sem_*). > > Signed-off-by: Stéphane Graber > --- > src/lxc/Makefile.am | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

Re: [lxc-devel] [PATCH] Link against pthread when not on bionic.

2013-02-19 Thread Natanael Copa
On Mon, 18 Feb 2013 21:40:42 +0100 Daniel Lezcano wrote: > On 02/18/2013 06:23 PM, Stéphane Graber wrote: > > dpkg spotted that we're not explicitly linking against pthread even though > > we use some of its symbols (sem_*). > > uh ? wait. > > We shouldn't link against the lib pthread. > > I d

[lxc-devel] [PATCH] lxc-alpine: autodetect standard bridges and set hwaddress

2013-02-13 Thread Natanael Copa
Check for lxcbr0, virbr0 and br0 and use one of those if they exist. Set mac address if network type is veth. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/templates/lxc

Re: [lxc-devel] [PATCH v2] add lua binding for the lxc API

2013-01-31 Thread Natanael Copa
On Tue, 29 Jan 2013 14:43:45 -0500 Dwight Engen wrote: > Hi Natanael, thanks for the review! > > On Tue, 29 Jan 2013 09:46:29 +0100 > Natanael Copa wrote: > > [...] > > > --- /dev/null > > > +++ b/src/lua-lxc/Makefile.am > > > @@ -0,0 +1,26

Re: [lxc-devel] [PATCH v2] add lua binding for the lxc API

2013-01-29 Thread Natanael Copa
On Tue, 29 Jan 2013 09:46:29 +0100 Natanael Copa wrote: > > I think that we should use 'pkg-config --exists' instead of testing for given > distros. > > Something like: > if pkg-config --exists lua5.1; then > LUAPKGCONFIG=lua5.1 > else > LUAPKGCON

Re: [lxc-devel] [PATCH v2] add lua binding for the lxc API

2013-01-29 Thread Natanael Copa
Thanks you very much for working on those bindings! I think the code is good enough for inclusion in git, even if I have some comments. On Thu, 24 Jan 2013 11:42:22 -0500 Dwight Engen wrote: > +# Lua module and scripts > +if test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" ; the

Re: [lxc-devel] [Lxc-users] lxc-ps lxc-netstat not working

2013-01-07 Thread Natanael Copa
On Mon, 7 Jan 2013 09:33:30 -0600 Serge Hallyn wrote: > Quoting Shibashish (shi...@gmail.com): > > I am on CentOS 6.3 and got lxc working on it. But when I run lxc-ps > > or lxc-netstat, i get the following errors... > > > > lxc-ps: no cgroup mount point found > > lxc-netstat: no cgroup mount po

[lxc-devel] [PATCH] lxc-shutdown: special handling for busybox init signals

2013-01-04 Thread Natanael Copa
busybox uses different signals for poweroff and reboot. Check if init is a symlink to busybox and use the busybox variants, USR2 and TERM. Signed-off-by: Natanael Copa --- I have only tested this busybox so please test before pusing it. Thanks! src/lxc/lxc-shutdown.in | 14 -- 1

Re: [lxc-devel] [PATCH] lxc-shutdown: use posix shell instead of bash

2013-01-04 Thread Natanael Copa
On Wed, 02 Jan 2013 13:49:51 -0500 Stéphane Graber wrote: > Turns out that not all kill implementations allow "-s SIG", some > instead required "-s ". As far as I can tell, all > implementations support the latter, so I pushed a change to use that > instead. Sorry about that. lxc-shutdown does

[lxc-devel] [PATCH] lxc-ps: fix order of output and fix --lxc opt

2013-01-04 Thread Natanael Copa
We must output the lines from 'ps' in same order for tree views. Fix also --lxc option to only show processes from containers. Signed-off-by: Natanael Copa --- The logic was wrong. Sorry. src/lxc/lxc-ps.in | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff -

[lxc-devel] [PATCH 1/5] templates: install lxc-alpine

2012-12-31 Thread Natanael Copa
Make sure we actually install lxc-alpine Signed-off-by: Natanael Copa --- templates/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/Makefile.am b/templates/Makefile.am index 9a94f32..be7e9f6 100644 --- a/templates/Makefile.am +++ b/templates

[lxc-devel] [PATCH 4/5] lxc-alpine: add support for setting arch from command line

2012-12-31 Thread Natanael Copa
This allows us to lxc-create 32 bit guests on x86_64 hosts. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 87886f5..5b685b1 100644

[lxc-devel] [PATCH 5/5] lxc-alpine: add support for installing optional packages

2012-12-31 Thread Natanael Copa
Let users append a list of packages they want install in the container Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 5b685b1..b06215f 100644 --- a

[lxc-devel] [PATCH 2/5] lxc-alpine: indent fixes

2012-12-31 Thread Natanael Copa
Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 6f7c90d..7787e75 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in

[lxc-devel] [PATCH 3/5] lxc-alpine: add --repository option

2012-12-31 Thread Natanael Copa
This allows specifying what repository to use for the container. Signed-off-by: Natanael Copa --- templates/lxc-alpine.in | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 7787e75..87886f5 100644 --- a/templates

[lxc-devel] [PATCH] cleanup: use lxc-info --state-is

2012-12-28 Thread Natanael Copa
We now have the possibility to test for a given state. Use this feature instead of parsing output with grep or awk Signed-off-by: Natanael Copa --- src/lxc/lxc-clone.in| 2 +- src/lxc/lxc-destroy.in | 5 ++--- src/lxc/lxc-netstat.in | 3 +-- src/lxc/lxc-shutdown.in | 6 +- 4 files

[lxc-devel] [PATCH] lxc-shutdown: use posix shell instead of bash

2012-12-27 Thread Natanael Copa
- avoid getopt --longoptions - use 'which' instead of 'type' to detect existance of tools - specify -s SIG with kill Signed-off-by: Natanael Copa --- dash didn't complain when I tested it, but it did not shut down the container due to busybox init uses other signals

[lxc-devel] [PATCH] lxc-ps: use posix shell and awk instead of bash

2012-12-26 Thread Natanael Copa
that include spaces. This also makes it work with busybox 'ps'. Signed-off-by: Natanael Copa --- src/lxc/lxc-ps.in | 92 --- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/src/lxc/lxc-ps.in b/src/lxc/lxc-ps.in index

[lxc-devel] [PATCH 2/2] legacy/lxc-ls: improve finding fs mountpoint of hierarchy

2012-12-26 Thread Natanael Copa
We cannot assume that the mount source name always starts with 'cgroup' so we check the filesystem type instead. Use 'awk' instead of 'grep -E' and as it is a better tool for this job. This fixes the tool on systems using openrc. Signed-off-by: Natanael Copa ---

[lxc-devel] [PATCH 1/2] lxc-netstat: improve finding fs mountpoint of hierarchy

2012-12-26 Thread Natanael Copa
We cannot assume that the mount source name always starts with 'cgroup' so we check the filesystem type instead. Use 'awk' instead of 'grep -E' and as it is a better tool for this job. This fixes the tool on systems using openrc. Signed-off-by: Natanael Copa -

Re: [lxc-devel] [PATCH 2/4] legacy/lxc-ls: use posix shell instead of bash

2012-12-25 Thread Natanael Copa
On Tue, 25 Dec 2012 17:36:12 +0100 Stéphane Graber wrote: > On 12/25/2012 05:08 PM, Natanael Copa wrote: > > Signed-off-by: Natanael Copa ... > Pushed to staging. Thanks. > > I also fixed a minor indent problem in that commit (the last esac was > space indented instead of

[lxc-devel] [PATCH 2/4] legacy/lxc-ls: use posix shell instead of bash

2012-12-25 Thread Natanael Copa
- use case .. in instead of comparison with globs - avoid 'local' While here, also avoid 'find ... -printf' which is not supported on busybox Signed-off-by: Natanael Copa --- src/lxc/legacy/lxc-ls.in | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-)

[lxc-devel] [PATCH 4/4] lxc-netstat: use posix shell instead of bash

2012-12-25 Thread Natanael Copa
- use case .. in instead of comparison with globs - avoid 'local' Signed-off-by: Natanael Copa --- src/lxc/lxc-netstat.in | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in index df18620..87bd3eb 100644 ---

[lxc-devel] [PATCH 1/4] lxc-destroy: use posix shell instead of bash

2012-12-25 Thread Natanael Copa
- avoid use getopt --longoptions Signed-off-by: Natanael Copa --- src/lxc/lxc-destroy.in | 41 + 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in index 1527495..0c27e4a 100644 --- a/src/lxc

[lxc-devel] [PATCH 3/4] lxc-clone: use posix shell instead of bash

2012-12-25 Thread Natanael Copa
- avoid getopt --longoptions - use 'which' instead of 'type' to detect existance of tools - use 'grep -q -w' instead of bash substring variable expansion ${line:0:18} Signed-off-by: Natanael Copa --- src/lxc/lxc-clone.in | 56 +-

[lxc-devel] [PATCH] lxc-checkconfig: fix colors when using dash

2012-12-25 Thread Natanael Copa
The \e did not work as expected on dash. Replace with proper posix \033 Signed-off-by: Natanael Copa --- src/lxc/lxc-checkconfig.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-checkconfig.in b/src/lxc/lxc-checkconfig.in index 13dbf3b..472755f 100644

[lxc-devel] [PATCH] define MS_SHARED if needed

2012-12-25 Thread Natanael Copa
Fixes build on uClibc. Signed-off-by: Natanael Copa --- src/lxc/conf.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 96940b3..c82e759 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -87,6 +87,10 @@ lxc_log_define(lxc_conf, lxc); #define

[lxc-devel] [PATCH] templates: initial support for Alpine Linux

2012-12-24 Thread Natanael Copa
Requires apk-tools (http://git.alpinelinux.org/cgit/apk-tools) Signed-off-by: Natanael Copa --- .gitignore | 1 + configure.ac| 1 + templates/lxc-alpine.in | 190 3 files changed, 192 insertions(+) create mode

Re: [lxc-devel] [PATCHv2] lxc-create: Store template information in config

2012-11-30 Thread Natanael Copa
On Fri, 30 Nov 2012 17:01:59 -0500 Stéphane Graber wrote: > Change lxc-create to add the name of the template, checksum and any > parameters > to the container's configuration. > This makes it easier to debug and figure out exactly how a container > was built. > > Signed-off-by: Stéphane Graber

Re: [lxc-devel] [PATCH] Create busybox commands as symlinks instead of hardlinks

2012-11-30 Thread Natanael Copa
On Fri, 30 Nov 2012 11:49:25 -0500 Dwight Engen wrote: > +# it would be nice to just use "chroot $rootfs busybox --install > -s /bin" > +# but that only works right in a chroot with busybox >= 1.19.0 I think it should work with busybox before 1.19 if you make sure /proc/self/exe works in

[lxc-devel] [PATCH v2] lxc-checkconfig: use POSIX shell instead of bash

2012-11-26 Thread Natanael Copa
- replace 'echo -e' with printf - replace 'if [[ ... ]]' with 'if [ ... ]' - add \ at after && and || when those are at end of line Signed-off-by: Natanael Copa --- Changes v1 -> v2: - rebase against current staging src/lxc/lxc-checkconfig.in | 32

[lxc-devel] [PATCH v2] lxc-version: use POSIX shell instead of bash

2012-11-26 Thread Natanael Copa
There is no reason to depend on bash for a single echo. Signed-off-by: Natanael Copa --- Changes v1 -> v2: - add signed-off-by src/lxc/lxc-version.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-version.in b/src/lxc/lxc-version.in index 1bd055a..b687

[lxc-devel] [PATCH] lxc-setuid: use POSIX shell instead of bash

2012-11-26 Thread Natanael Copa
Avoid getop --longoptions. Signed-off-by: Natanael Copa --- src/lxc/lxc-setuid.in | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/lxc/lxc-setuid.in b/src/lxc/lxc-setuid.in index 84f18af..e6a7b96 100644 --- a/src/lxc/lxc-setuid.in

[lxc-devel] [PATCH] lxc-setcap: use POSIX shell instead of bash

2012-11-26 Thread Natanael Copa
Avoid getopt --longoptions Signed-off-by: Natanael Copa --- src/lxc/lxc-setcap.in | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/lxc/lxc-setcap.in b/src/lxc/lxc-setcap.in index 7fd390c..02c1e09 100644 --- a/src/lxc/lxc-setcap.in

[lxc-devel] [PATCH] lxc-version: use POSIX shell instead of bash

2012-11-26 Thread Natanael Copa
There is no reason to depend on bash for a single echo. --- Should we move this to lxc-info --version? src/lxc/lxc-version.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-version.in b/src/lxc/lxc-version.in index 1bd055a..b6875da 100644 --- a/src/lxc/lxc-version

[lxc-devel] [PATCH] lxc-info: add option -t, --state-is=STATE to test for a given test

2012-11-26 Thread Natanael Copa
Add an option to test for a give state. This is useful for scripts. It lets us you do thing like: if lxc-info --name myname --state-is RUNNING; then ... Signed-off-by: Natanael Copa --- src/lxc/lxc_info.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a

[lxc-devel] [PATCH] lxc-create: do not use 'local'

2012-11-26 Thread Natanael Copa
Apparently 'local' is not POSIX. Don't use it. Signed-off-by: Natanael Copa --- src/lxc/lxc-create.in | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index 26ec6a2..30f0c22 100644 --- a/src/lxc/lxc-create.i

Re: [lxc-devel] [PATCH] Rewrite lxc-ls in python

2012-11-22 Thread Natanael Copa
On Wed, 21 Nov 2012 18:04:03 -0500 Stéphane Graber wrote: > This rewrite is mostly compatible with the shell version. > --active and -1 still work and behave as they used to. Does this mean that python will be a requirement for lxc in future? I am currently working on switching things from vserv

[lxc-devel] [PATCH] lxc-create: fix passing over first argument to template script

2012-11-22 Thread Natanael Copa
The e60a8164c12d565f70071ff6b32b823dd495df9e introduced a bug that caused first argument passed over to the template script get lost. This patch fixes it. Signed-off-by: Natanael Copa --- src/lxc/lxc-create.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lxc/lxc-create.in b/src/lxc

[lxc-devel] [PATCH] lxc-create: use posix shell instead of bash

2012-11-16 Thread Natanael Copa
- use '[ -x /path/prog ]' instead of 'type /path/prog' - avoid getopt --longoptions - add \ at after && and || when those are at end of line - make sure condition expands to empty string if variable is empty Signed-off-by: Natanael Copa --- I have tested it with &#x

Re: [lxc-devel] using posix shell instead of bash

2012-11-16 Thread Natanael Copa
On Wed, 14 Nov 2012 09:54:58 -0600 Serge Hallyn wrote: > Successful runs of > https://code.launchpad.net/~serge-hallyn/+junk/lxc-test with your > patches will also be reassuring. This is causing problems for me: if dist[0] != "Ubuntu": print >>sys.stderr, "This test suite does not

[lxc-devel] [PATCH] lxc-checkconfig: use posix shell instead of bash

2012-11-15 Thread Natanael Copa
- replace 'echo -e' with printf - replace 'if [[ ... ]]' with 'if [ ... ]' - add \ at after && and || when those are at end of line Signed-off-by: Natanael Copa --- I have tested the patch locally and it appears to work. On busybox 'echo -e

[lxc-devel] [PATCH v2] lxc-start: add option -p, --pidfile=FILE

2012-11-15 Thread Natanael Copa
Add option to create a pidfile for lxc-start. This is helpful for init scripts and process monitors when running as daemon. Signed-off-by: Natanael Copa --- Changes v1 -> v2: - allow use --pidfile without --daemon - update the doc to reflect the above - reword usage help text slightly

Re: [lxc-devel] using posix shell instead of bash

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 13:50:54 -0500 "Michael H. Warfield" wrote: > Converting from bash to ash (which is very sh like) isn't too bad if > you are not making extensive use of arrays and string functions. It's > probably doable (having done it myself with some fairly sophisticated > bash scripts de

Re: [lxc-devel] using posix shell instead of bash

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 09:54:58 -0600 Serge Hallyn wrote: > Quoting Natanael Copa (nc...@alpinelinux.org): forgot this... > > Would you be prepared for minor sacrifices to use posix compliant > > shell scripts? > > Someone else can jump in if they object, but I persona

Re: [lxc-devel] using posix shell instead of bash

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 09:54:58 -0600 Serge Hallyn wrote: > (Note also that lxc-ls may be rewritten in python. Is that a problem > for your use case?) well... The Alpine Linux base system is 6MB excluding kernel. I offer to spend a day or so to save 700kb by getting rid of bash. and now you want

Re: [lxc-devel] [PATCH] lxc-start: add option -p, --pidfile=FILE for use with --daemon

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 08:44:41 -0600 Serge Hallyn wrote: > Quoting Natanael Copa (nc...@alpinelinux.org): > > Add option to create a pidfile for lxc-start daemon. This is helpful > > for init scripts and process monitors. > > Why only when daemonizing? Someone could presu

Re: [lxc-devel] [PATCH] lxc-destroy: make it work with busybox

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 08:51:07 -0600 Serge Hallyn wrote: > Quoting Natanael Copa (nc...@alpinelinux.org): > > Busybox 'rm' has no support for --one-file-system. We can make it > > work on busybox with find ... -xdev. > > Hm, well it does slow it down a smidgeon,

Re: [lxc-devel] using posix shell instead of bash

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 14:04:43 +0100 Natanael Copa wrote: > @@ -18,10 +18,11 @@ > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > 02111-1307 USA > lxc_path=@LXCPATH@ > +program=${0##*/} > > usage() > { > - echo "usage: $(basename $0) [--act

Re: [lxc-devel] using posix shell instead of bash

2012-11-14 Thread Natanael Copa
On Wed, 14 Nov 2012 08:40:39 +0100 Natanael Copa wrote: > I wonder if it there are any interest to make the scripts posix shell > compliant so they can run with for example busybox ash and dash. I should maybe add that I think the biggest challenge will be the longopts parsing. That said

[lxc-devel] using posix shell instead of bash

2012-11-13 Thread Natanael Copa
Hi, I wonder if it there are any interest to make the scripts posix shell compliant so they can run with for example busybox ash and dash. I would like to provide proper LCX support for Alpine Linux, which by default runs from tmpfs. It uses uclibc and busybox as the base system, which makes it v

[lxc-devel] [PATCH] lxc-destroy: make it work with busybox

2012-11-13 Thread Natanael Copa
Busybox 'rm' has no support for --one-file-system. We can make it work on busybox with find ... -xdev. Signed-off-by: Natanael Copa --- src/lxc/lxc-destroy.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in ind

[lxc-devel] [PATCH] lxc-start: add option -p, --pidfile=FILE for use with --daemon

2012-11-13 Thread Natanael Copa
Add option to create a pidfile for lxc-start daemon. This is helpful for init scripts and process monitors. Signed-off-by: Natanael Copa --- doc/lxc-start.sgml.in | 12 src/lxc/arguments.h | 1 + src/lxc/lxc_start.c | 24 3 files changed, 37 insertions