From 3381e4d5edb309c45ad2b947270f15c8679919c1 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 29 Jan 2015 14:40:25 -0500 Subject: lxc: install initscripts lxc comes with sysvinit and systemd initscripts that autostart containers and check for required services. So we should be installing and enabling them. Signed-off-by: Bruce Ashfield --- recipes-containers/lxc/lxc_1.0.7.bb | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/recipes-containers/lxc/lxc_1.0.7.bb b/recipes-containers/lxc/lxc_1.0.7.bb index 952c9262..b1f47391 100644 --- a/recipes-containers/lxc/lxc_1.0.7.bb +++ b/recipes-containers/lxc/lxc_1.0.7.bb @@ -47,16 +47,28 @@ PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparm PACKAGECONFIG[templates] = ",,, ${PN}-templates" PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" -inherit autotools pkgconfig ptest +inherit autotools pkgconfig ptest update-rc.d systemd + +SYSTEMD_PACKAGES = "${PN}-setup" +SYSTEMD_SERVICE_${PN}-setup = "lxc.service" +SYSTEMD_AUTO_ENABLE_${PN}-setup = "enable" + +INITSCRIPT_PACKAGES = "${PN}-setup" +INITSCRIPT_NAME_{PN}-setup = "lxc" +INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}" FILES_${PN}-doc = "${mandir} ${infodir}" # For LXC the docdir only contains example configuration files and should be included in the lxc package FILES_${PN} += "${docdir}" FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" -PACKAGES =+ "${PN}-templates" +PACKAGES =+ "${PN}-templates ${PN}-setup" FILES_${PN}-templates += "${datadir}/lxc/templates" RDEPENDS_${PN}-templates += "bash" +FILES_${PN}-setup += "/etc/tmpfiles.d" +FILES_${PN}-setup += "/lib/systemd/system" +FILES_${PN}-setup += "/etc/init.d" + PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" do_install_append() { @@ -69,6 +81,15 @@ do_install_append() { for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done + + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + cp ${S}/config/init/sysvinit/lxc ${D}${sysconfdir}/init.d + else + install -d ${D}${systemd_unitdir}/system + install -m 755 ${S}/config/init/systemd/lxc.service ${D}${systemd_unitdir}/system/lxc.service + install -m 755 ${S}/config/init/systemd/lxc-devsetup ${D}${libexecdir}/lxc/ + fi } EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" -- cgit v1.2.3-54-g00ecf