From 4af5c17fb1da5c3d6fbbd2d13174326e04147610 Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Sat, 21 May 2016 23:30:02 +0100 Subject: [PATCH] Set the hostname to the name of the container --- templates/lxc-debian-unprivileged | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/lxc-debian-unprivileged b/templates/lxc-debian-unprivileged index bc6288b..3311609 100755 --- a/templates/lxc-debian-unprivileged +++ b/templates/lxc-debian-unprivileged @@ -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 < ${LXC_ROOTFS}/etc/apt/sources.list deb $DEBIAN_MIRROR $DEBIAN_RELEASE main -- 2.39.5