[lxc-devel] [lxc/master] OpenSUSE systemd fixes

evgeni on Github lxc-bot at linuxcontainers.org
Thu Dec 15 19:04:51 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161215/8f8c5e8d/attachment.bin>
-------------- next part --------------
From 000f7f1c561b86c3cc5a275d06e2ff6e7fc03452 Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni at debian.org>
Date: Thu, 15 Dec 2016 19:59:13 +0100
Subject: [PATCH 1/2] don't try to get stuff from /usr/lib/systemd on the host
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

it might not even be thereā€¦

Signed-off-by: Evgeni Golov <evgeni at debian.org>
---
 templates/lxc-opensuse.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index 0774397..59180df 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -101,7 +101,7 @@ EOF
     ln -s /dev/null $rootfs/etc/systemd/system/proc-sys-fs-binfmt_misc.automount
     ln -s /dev/null $rootfs/etc/systemd/system/console-shell.service
     ln -s /dev/null $rootfs/etc/systemd/system/systemd-vconsole-setup.service
-    sed -e 's/ConditionPathExists=.*//' /usr/lib/systemd/system/getty at .service > $rootfs/etc/systemd/system/getty at .service
+    sed -e 's/ConditionPathExists=.*//' $rootfs/usr/lib/systemd/system/getty at .service > $rootfs/etc/systemd/system/getty at .service
     ln -s getty at .service $rootfs/etc/systemd/system/getty at tty1.service
     ln -s ../getty at .service $rootfs/etc/systemd/system/getty.target.wants/getty at console.service
     ln -s -f ../getty at .service $rootfs/etc/systemd/system/getty.target.wants/getty at tty1.service
@@ -111,7 +111,7 @@ EOF
 
     # copy host poweroff target as sigpwr target to make shutdown work
     # see https://wiki.archlinux.org/index.php/Linux_Containers#Container_cannot_be_shutdown_if_using_systemd
-    cp /usr/lib/systemd/system/poweroff.target $rootfs/usr/lib/systemd/system/sigpwr.target
+    cp $rootfs/usr/lib/systemd/system/poweroff.target $rootfs/usr/lib/systemd/system/sigpwr.target
 
     touch $rootfs/etc/sysconfig/kernel
 

From 62386d93199031833a6e25234de914cc4252c165 Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni at debian.org>
Date: Thu, 15 Dec 2016 20:02:10 +0100
Subject: [PATCH 2/2] lxc-opensuse: rm poweroff.target -> sigpwr.target copy

Given commit 330ae3d350e060e5702a0e5ef5d0faeeeea8df6e:

    lxccontainer: detect if we should send SIGRTMIN+3

    This is required by systemd to cleanly shutdown. Other init systems should not
    have SIGRTMIN+3 in the blocked signals set.

we should stop poking around with sigpwr.target for systemd.

Signed-off-by: Evgeni Golov <evgeni at debian.org>
---
 templates/lxc-opensuse.in | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index 59180df..66176c3 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -109,10 +109,6 @@ EOF
     ln -s ../getty at .service $rootfs/etc/systemd/system/getty.target.wants/getty at tty3.service
     ln -s ../getty at .service $rootfs/etc/systemd/system/getty.target.wants/getty at tty4.service
 
-    # copy host poweroff target as sigpwr target to make shutdown work
-    # see https://wiki.archlinux.org/index.php/Linux_Containers#Container_cannot_be_shutdown_if_using_systemd
-    cp $rootfs/usr/lib/systemd/system/poweroff.target $rootfs/usr/lib/systemd/system/sigpwr.target
-
     touch $rootfs/etc/sysconfig/kernel
 
     echo "Please change root-password !"


More information about the lxc-devel mailing list