From: Felix Abecassis Date: Tue, 21 Nov 2017 21:49:30 +0000 (-0800) Subject: lxc-oci: write /etc/hostname X-Git-Tag: lxc-3.0.0.beta1~176^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc2c91ae99b4104f49827baeab32a71b5aa21d50;p=thirdparty%2Flxc.git lxc-oci: write /etc/hostname Signed-off-by: Felix Abecassis --- diff --git a/templates/lxc-oci.in b/templates/lxc-oci.in index dac3eebec..3a52acd9d 100755 --- a/templates/lxc-oci.in +++ b/templates/lxc-oci.in @@ -204,7 +204,11 @@ LXC_CONF_FILE="${LXC_PATH}/config" echo "lxc.execute.cmd = '${entrypoint}'" >> "${LXC_CONF_FILE}" echo "lxc.mount.auto = proc:mixed sys:mixed cgroup:mixed" >> "${LXC_CONF_FILE}" -echo "lxc.uts.name = ${LXC_NAME}" >> ${LXC_PATH}/config +echo "lxc.uts.name = ${LXC_NAME}" >> "${LXC_CONF_FILE}" +# set the hostname +cat < ${LXC_ROOTFS}/etc/hostname +${LXC_NAME} +EOF if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then chown $LXC_MAPPED_UID $LXC_PATH/config $LXC_PATH/fstab >/dev/null 2>&1 || true