From 1365af123e45c8cc65b4206f9b5a6cca787438b6 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Sat, 11 Apr 2015 00:15:51 -0400 Subject: lxc: fix systemd init issues To generate a proper systemd.service file we should use lxc's builtin configuration option for the initscript type. To support both sysvinit and systemd, we trigger off the DISTRO var and enable the proper init system accordingly. When properly configured, lxc will create helper scripts and install the service file, so we can delete the explicit copy of the service file and let the default rules trigger and install what is needed. The helper files installed by lxc require a lsb function that is not commonly available in the 'functions' library: "action". To ensure that the helper scripts operate, we create a local action() routine with the expected semantics. Signed-off-by: Bruce Ashfield --- .../lxc-helper-create-local-action-function.patch | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch (limited to 'recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch') diff --git a/recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch b/recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch new file mode 100644 index 00000000..d1d31eea --- /dev/null +++ b/recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch @@ -0,0 +1,38 @@ +From aada9da49caca9e4a25764df2d2a2c11d9d95dbb Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Fri, 10 Apr 2015 10:55:49 -0400 +Subject: [PATCH] lxc-helper: create local action() function + +Signed-off-by: Bruce Ashfield +--- + config/init/sysvinit/lxc.in | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/config/init/sysvinit/lxc.in b/config/init/sysvinit/lxc.in +index 19c102e74c86..9f96a4f7496f 100644 +--- a/config/init/sysvinit/lxc.in ++++ b/config/init/sysvinit/lxc.in +@@ -52,6 +52,20 @@ test ! -r "$sysconfdir"/sysconfig/lxc || + # Check for needed utility program + [ -x "$bindir"/lxc-autostart ] || exit 1 + ++action() ++{ ++ local STRING rc ++ ++ STRING=$1 ++ echo -n "$STRING " ++ ++ shift ++ "$@" && success $"$STRING" || failure $"$STRING" ++ rc=$? ++ ++ return $rc ++} ++ + # If libvirtd is providing the bridge, it might not be + # immediately available, so wait a bit for it before starting + # up the containers or else any that use the bridge will fail +-- +2.1.0 + -- cgit v1.2.3-54-g00ecf