[lxc-devel] [PATCH] lxc-oracle: set hostname with systemd

Dwight Engen dwight.engen at oracle.com
Tue May 20 14:33:30 UTC 2014


Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
 templates/lxc-oracle.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in
index 2fa289b..8a8c821 100644
--- a/templates/lxc-oracle.in
+++ b/templates/lxc-oracle.in
@@ -340,6 +340,10 @@ TYPE=Ethernet
 EOF
 
     # set the hostname
+    if [ $container_release_major -ge "7" ]; then
+        # systemd honors /etc/hostname
+        echo "$name" >$container_rootfs/etc/hostname
+    fi
     cat <<EOF > $container_rootfs/etc/sysconfig/network
 NETWORKING=yes
 NETWORKING_IPV6=no
-- 
1.9.0



More information about the lxc-devel mailing list