[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Workaround for hostid on Darwin 8/MacPPC
From: |
C. Speare |
Subject: |
Re: Workaround for hostid on Darwin 8/MacPPC |
Date: |
Fri, 4 May 2007 23:01:40 -0400 (EDT) |
Ok, a (hopefully) better idea.
If the value of id is 0, don't return anything and exit with EXIT_FAILURE.
That maintains consistency and makes the user aware that something is
seriously broken. [By the same view, returning a well-known value, like
0xdeadbeef or similar, could serve the same purpose; it seems more
cautious to not return anything, though.]
For my purposes, it is enough that I can set the hostid via a sysctl, and
hostid will function just fine:
ppc7447% hostid
00000000
ppc7447% sudo sysctl -w kern.hostid=0xcafe0def
kern.hostid: 0 -> 3405647343
ppc7447% hostid
cafe0def
ppc7447% hostid --version
hostid (GNU coreutils) 6.9
So, I can get around a broken hostid - the responsbility of coming up with
a consistent [and hopefully unique] hostid is now on the administrator [or
OS vendor].
On Thu, 3 May 2007, John Cowan wrote:
C. Speare scripsit:
A possible (but weak) workaround is to test for the case where id is 0.
It's fine to detect that case, but the whole idea of hostid is to
return the same value each time it's called on the same host,
so returning a random value is unhelpful.
--
Work hard, John Cowan
play hard, address@hidden
die young, http://www.ccil.org/~cowan
rot quickly.