diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-04-11 00:15:51 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-04-11 00:17:55 -0400 |
commit | 1365af123e45c8cc65b4206f9b5a6cca787438b6 (patch) | |
tree | f912fc8d92628e84359e9c49419f9a8afb3664fd /recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch | |
parent | 19ca5c408ad14bef81d3e785f0cb4a70e95db467 (diff) | |
download | meta-virtualization-1365af123e45c8cc65b4206f9b5a6cca787438b6.tar.gz |
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 <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch')
-rw-r--r-- | recipes-containers/lxc/files/lxc-helper-create-local-action-function.patch | 38 |
1 files changed, 38 insertions, 0 deletions
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 @@ | |||
1 | From aada9da49caca9e4a25764df2d2a2c11d9d95dbb Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Fri, 10 Apr 2015 10:55:49 -0400 | ||
4 | Subject: [PATCH] lxc-helper: create local action() function | ||
5 | |||
6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
7 | --- | ||
8 | config/init/sysvinit/lxc.in | 14 ++++++++++++++ | ||
9 | 1 file changed, 14 insertions(+) | ||
10 | |||
11 | diff --git a/config/init/sysvinit/lxc.in b/config/init/sysvinit/lxc.in | ||
12 | index 19c102e74c86..9f96a4f7496f 100644 | ||
13 | --- a/config/init/sysvinit/lxc.in | ||
14 | +++ b/config/init/sysvinit/lxc.in | ||
15 | @@ -52,6 +52,20 @@ test ! -r "$sysconfdir"/sysconfig/lxc || | ||
16 | # Check for needed utility program | ||
17 | [ -x "$bindir"/lxc-autostart ] || exit 1 | ||
18 | |||
19 | +action() | ||
20 | +{ | ||
21 | + local STRING rc | ||
22 | + | ||
23 | + STRING=$1 | ||
24 | + echo -n "$STRING " | ||
25 | + | ||
26 | + shift | ||
27 | + "$@" && success $"$STRING" || failure $"$STRING" | ||
28 | + rc=$? | ||
29 | + | ||
30 | + return $rc | ||
31 | +} | ||
32 | + | ||
33 | # If libvirtd is providing the bridge, it might not be | ||
34 | # immediately available, so wait a bit for it before starting | ||
35 | # up the containers or else any that use the bridge will fail | ||
36 | -- | ||
37 | 2.1.0 | ||
38 | |||