[lxc-devel] [lxc/master] lxc-centos.in: Change default target to multi-user and make systemd honor SIGPWR when CentOS 7

etcet on Github lxc-bot at linuxcontainers.org
Sun Jul 24 04:24:01 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 458 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160724/319ae6db/attachment.bin>
-------------- next part --------------
From 79474e38851754bb82a8c299810ba80fefc1ade4 Mon Sep 17 00:00:00 2001
From: chris <chris at lxd.home.internal>
Date: Sat, 23 Jul 2016 23:19:42 -0500
Subject: [PATCH] Change default target to multi-user and make systemd honor
 SIGPWR

---
 templates/lxc-centos.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in
index 051faef..544715c 100644
--- a/templates/lxc-centos.in
+++ b/templates/lxc-centos.in
@@ -398,6 +398,12 @@ start on power-status-changed
 
 exec /sbin/shutdown -h now "SIGPWR received"
 EOF
+    else
+        # Change default target from graphical to multi-user
+        rm -f ${rootfs_path}/etc/systemd/system/default.target
+        chroot ${rootfs_path} ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
+        # Make systemd honor SIGPWR
+        chroot ${rootfs_path} ln -s /usr/lib/systemd/system/halt.target /etc/systemd/system/sigpwr.target
     fi
 }
 


More information about the lxc-devel mailing list