]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-oracle: set hostname with systemd
authorDwight Engen <dwight.engen@oracle.com>
Tue, 20 May 2014 14:33:30 +0000 (10:33 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 20 May 2014 14:49:18 +0000 (10:49 -0400)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-oracle.in

index 2fa289b7b1851422346a50c325efcea3adb7cd7b..8a8c821e1d70db21835800b972d374902c946960 100644 (file)
@@ -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