[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

lh_chroot_hostname changes my hostname back and forth



I'm really confused by this.  First, why is it necessary to set the
hostname (within the chroot, I guess with the unfortunate but
[perhaps?] unavoidable consequence that it affects outside the chroot
too).

Second, why isn't it clear why the hostname shouldn't be changed back?
Otherwise everyone's machine gets renamed localhost.localdomain.

Justin

		if [ -f chroot/etc/hostname ]
		then
			# Save hostname file
			mv chroot/etc/hostname chroot/etc/hostname.orig
		fi

		# Create hostname file
		echo "localhost.localdomain" > chroot/etc/hostname

		# Set hostname
		Chroot "hostname -F /etc/hostname"
[...]

		# Set hostname (somehow this seems to be really needed :/)
		if [ -f /etc/hostname ]
		then
			hostname -F /etc/hostname
		fi



Reply to: