Set the hostname to the name of the container
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Sat, 21 May 2016 22:30:02 +0000 (23:30 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Sat, 21 May 2016 22:30:02 +0000 (23:30 +0100)
templates/lxc-debian-unprivileged

index bc6288b8eb69f9a14f24d9e998ca239448e007dd..33116094095730ce833184ab5e0aecf443853e68 100755 (executable)
@@ -191,6 +191,9 @@ fi
 # remove some interesting breakages in pam for unpriv foo
 sed -i -e 's#^\(session.*required.*pam_loginuid.so\)#\#\1#;' ${LXC_ROOTFS}/etc/pam.d/*
 
+# set the hostname
+echo $LXC_NAME > ${LXC_ROOTFS}/etc/hostname
+
 # setup sources.list
 cat <<EOF > ${LXC_ROOTFS}/etc/apt/sources.list
 deb $DEBIAN_MIRROR $DEBIAN_RELEASE main