[lxc-devel] [lxc/master] debian: Make systemd honor SIGPWR

fanyeren on Github lxc-bot at linuxcontainers.org
Tue Sep 6 09:22:11 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 434 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160906/0aa6ce65/attachment.bin>
-------------- next part --------------
From f17bb3c44111463dcbbf739f8885f29c5f80ebef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E5=BC=A0=E7=BA=B8?= <fanyeren at gmail.com>
Date: Tue, 6 Sep 2016 09:22:01 +0000
Subject: [PATCH] debian: Make systemd honor SIGPWR
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

without this symbolic(sigpwr) link, systemd-shutdownd hung in stopping container, so i think it's not a good idea to remove it!
---
 templates/lxc-debian.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in
index 6420b39..e469772 100644
--- a/templates/lxc-debian.in
+++ b/templates/lxc-debian.in
@@ -256,6 +256,11 @@ configure_debian_systemd()
     chroot "${rootfs}" ln -s /dev/null /etc/systemd/system/udev.service
     chroot "${rootfs}" ln -s /dev/null /etc/systemd/system/systemd-udevd.service
     chroot "${rootfs}" ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
+    
+    # Make systemd honor SIGPWR
+    chroot "${rootfs}" rm -f /etc/systemd/system/sigpwr.target
+    chroot "${rootfs}" ln -s /lib/systemd/system/halt.target /etc/systemd/system/sigpwr.target
+
     # Setup getty service on the ttys we are going to allow in the
     # default config.  Number should match lxc.tty
     ( cd "${rootfs}/etc/systemd/system/getty.target.wants"


More information about the lxc-devel mailing list