Re: [lxc-devel] [PATCH] ubuntu: Fix regression in post-process

2013-12-01 Thread S . Çağlar Onur
Hey Stéphane,

On Wed, Nov 27, 2013 at 7:49 PM, Stéphane Graber  wrote:
> THe recent reorg of lxc-ubuntu introduced some package installation in
> post-process but without first disabling service startup.
>
> As a result, if the cache is a bit out of date and a ssh update is
> available, post-process will apply that update (as it does apt-get
> install ssh vim) which in turn will attemp to start sshd. This will
> either lead to ssh on the host being restarted or if there's no sshd on
> the host, will fail the container creation as the postinst will get an
> error from upstart.
>
> The fix is very simply to add the same policy-rc.d trick when running
> post-process.

I'm not sure whether this is the desired outcome (I haven't taken a
look at it yet) but it looks like after this change "lxc-create -n t
-t ubuntu" started to take more time (order of couple of minutes) to
complete. This wasn't the case couple of weeks ago, when I last tried
creating an ubuntu container. I flushed the cache thinking that it's
age is the problem but it didn't change anything, container still
tries to install (or maybe upgrade) additional packages (I think vim
and ssh) via apt. Is there a reason not to include those additional
packages in the initial bootstrap phase?

> Signed-off-by: Stéphane Graber 
> ---
>  templates/lxc-ubuntu.in | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index ac39ed2..4e6a54f 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -467,6 +467,13 @@ post_process()
>  release=$2
>  packages=$3
>
> +# Disable service startup
> +cat > $rootfs/usr/sbin/policy-rc.d << EOF
> +#!/bin/sh
> +exit 101
> +EOF
> +chmod +x $rootfs/usr/sbin/policy-rc.d
> +
>  if [ ! -f $rootfs/etc/init/container-detect.conf ]; then
>  # Make sure we have a working resolv.conf
>  cresolvonf="${rootfs}/etc/resolv.conf"
> @@ -538,6 +545,9 @@ post_process()
>  mv $rootfs/dev/shm $rootfs/dev/shm.bak
>  ln -s /run/shm $rootfs/dev/shm
>  fi
> +
> +# Re-enable service startup
> +rm $rootfs/usr/sbin/policy-rc.d
>  }
>
>  do_bindhome()
> --
> 1.8.4.4
>
>
> --
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> ___
> Lxc-devel mailing list
> Lxc-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel



-- 
S.Çağlar Onur 

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH] Add LXC version information to version.h

2013-12-01 Thread S . Çağlar Onur
So that applications can get the LXC version number at compile time.

This can be used to make applications/bindings that support compiling against
multiple versions of LXC.

Signed-off-by: S.Çağlar Onur 
---
 .gitignore   |  1 +
 configure.ac |  7 ++-
 src/lxc/version.h| 31 ---
 src/lxc/version.h.in | 36 
 4 files changed, 43 insertions(+), 32 deletions(-)
 delete mode 100644 src/lxc/version.h
 create mode 100644 src/lxc/version.h.in

diff --git a/.gitignore b/.gitignore
index 65d9a77..a38ceb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,6 +74,7 @@ src/lxc/lxc-version
 src/lxc/lxc-wait
 src/lxc/legacy/lxc-ls
 src/lxc/lxc-user-nic
+src/lxc/version.h
 
 src/python-lxc/build/
 src/python-lxc/lxc/__pycache__/
diff --git a/configure.ac b/configure.ac
index e9d3128..7b3da91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,11 @@ AC_INIT([lxc], [lxc_version])
 AC_SUBST(LXC_VERSION_BASE, lxc_version_base)
 AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
 
+AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
+AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
+AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
+AC_SUBST([LXC_VERSION], [lxc_version])
+
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_AUX_DIR([config])
 AC_CONFIG_HEADERS([src/config.h])
@@ -554,7 +559,7 @@ AC_CONFIG_FILES([
src/lxc/lxc-start-ephemeral
src/lxc/legacy/lxc-ls
src/lxc/lxc.functions
-
+   src/lxc/version.h
src/python-lxc/Makefile
 
src/lua-lxc/Makefile
diff --git a/src/lxc/version.h b/src/lxc/version.h
deleted file mode 100644
index e2b0fc4..000
--- a/src/lxc/version.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano 
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef _version_h
-#define _version_h
-
-/*
- * Returns the version number of the library
- */
-extern const char *lxc_version(void);
-
-#endif
diff --git a/src/lxc/version.h.in b/src/lxc/version.h.in
new file mode 100644
index 000..6867b6e
--- /dev/null
+++ b/src/lxc/version.h.in
@@ -0,0 +1,36 @@
+/*
+ * lxc: linux Container library
+ *
+ * (C) Copyright IBM Corp. 2007, 2008
+ *
+ * Authors:
+ * Daniel Lezcano 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef _VERSION_H
+#define _VERSION_H
+
+#define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@
+#define LXC_VERSION_MINOR @LXC_VERSION_MINOR@
+#define LXC_VERSION_MICRO @LXC_VERSION_MICRO@
+#define LXC_VERSION "@LXC_VERSION@"
+
+/*
+ * Returns the version number of the library
+ */
+extern const char *lxc_version(void);
+
+#endif
-- 
1.8.3.2


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel