[lxc-devel] [lxc/master] Added OR for ID = rhel in RHEL 7+

hartnellfoster on Github lxc-bot at linuxcontainers.org
Mon May 9 10:32:03 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 475 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160509/a58bdbe5/attachment.bin>
-------------- next part --------------
From a886906d276aa69d99c8f68e39f80689db3d402a Mon Sep 17 00:00:00 2001
From: Hartnell Foster <hartnell.foster at bbc.co.uk>
Date: Mon, 9 May 2016 11:26:57 +0100
Subject: [PATCH] Added OR for ID = rhel in RHEL 7+

---
 templates/lxc-centos.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in
index ef8061c..d26e8ac 100644
--- a/templates/lxc-centos.in
+++ b/templates/lxc-centos.in
@@ -137,8 +137,9 @@ if [ "${CPE_NAME}" != "" -a "${ID}" = "centos" -a "${VERSION_ID}" != "" ]
 then
     centos_host_ver=${VERSION_ID}
     is_centos=true
-elif [ "${CPE_NAME}" != "" -a "${ID}" = "redhat" -a "${VERSION_ID}" != "" ]
+elif [ "${CPE_NAME}" != "" -a "${ID}" = "redhat" -o "${ID}" = "rhel" -a "${VERSION_ID}" != "" ]
 then
+    # RHEL 7+ /etc/os-release ID = 'rhel', which doesn't enter this elif without the added OR
     redhat_host_ver=${VERSION_ID}
     is_redhat=true
 elif [ -e /etc/centos-release ]
@@ -394,7 +395,7 @@ configure_centos_init()
 #  power-status-changed - shutdown on SIGPWR
 #
 start on power-status-changed
-    
+
 exec /sbin/shutdown -h now "SIGPWR received"
 EOF
     fi


More information about the lxc-devel mailing list