On 20/02/13 03:01, Carlos Alberto Lopez Perez wrote: > On 06/09/10 19:35, martin f krafft wrote: >> Package: coreutils >> Version: 8.5-1 >> Severity: normal >> File: /usr/bin/hostid >> Tags: upstream >> >> I have never come across a (Debian) system where /usr/bin/hostid >> didn't print 007f0101. That is because Debian uses /etc/hosts to map >> 127.0.1.1 to the hostname(s). >> >> Arguably, having a host UUID would be quite nice, but as there is no >> "one" IPv4 of a host, it's kinda useless to try to go that road. >> Unless hostid [well, gethostid()] can be replaced with something >> sensible, I suggest that it be removed from coreutils, or disabled, >> vandalised, or otherwise physically harmed. >> >> Btw, the info page says: >> >> the 32-bit quantity happens to be closely related to the system's >> Internet address, but that isn't always the case. >> >> and that's clearly wrong. Again, the days when a system had "an >> Internet address" are long gone, and apparently, it isn't even >> always the case. >> >> Feel free to reassign to glibc, where gethostid() comes from}. >> >> -- System Information: >> Debian Release: squeeze/sid >> APT prefers unstable >> APT policy: (500, 'unstable'), (1, 'experimental') >> Architecture: amd64 (x86_64) >> >> Kernel: Linux 2.6.35-trunk-amd64 (SMP w/1 CPU core) >> Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) >> Shell: /bin/sh linked to /bin/dash >> >> Versions of packages coreutils depends on: >> ii libacl1 2.2.49-3 Access control list shared >> library >> ii libattr1 1:2.4.44-2 Extended attribute shared >> library >> ii libc6 2.11.2-5 Embedded GNU C Library: Shared >> lib >> ii libselinux1 2.0.96-1 SELinux runtime shared libraries >> >> coreutils recommends no packages. >> >> coreutils suggests no packages. >> >> -- no debconf information >> >> > > I have been digging on how hostid works on Linux versus other UNIXes. Check: > > http://lists.alioth.debian.org/pipermail/pkg-zfsonlinux-devel/2013-February/000005.html > > > Perhaps a quick and easy solution for this issue will be to check if > /etc/hostid is already configured on the system, and if not, just set it > to a random value on the postinst of coreutils. Something like: > > > > if [ ! -f /etc/hostid ]; then > dd if=/dev/urandom bs=1 count=4 of=/etc/hostid 2>/dev/null > fi > > > > What do you think? >
Here is a great summary from Lennart Poettering about the sources of unique IDs on a Linux systems: http://0pointer.de/blog/projects/ids.html He agrees that the current status of hostid is useless on most distros, and he suggests to symlink /etc/hostid to /var/lib/dbus/machine-id (!!). IMHO A more reasonable approach that don't forces a dependency on dbus, is just to randomize /etc/hostid on the postinst of coreutils as I suggested previously. Regards!
signature.asc
Description: OpenPGP digital signature