From owner-freebsd-arch@FreeBSD.ORG Sat Apr 7 17:27:59 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D038D16A400 for ; Sat, 7 Apr 2007 17:27:59 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 65FB913C465 for ; Sat, 7 Apr 2007 17:27:59 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: by ug-out-1314.google.com with SMTP id 71so1355127ugh for ; Sat, 07 Apr 2007 10:27:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=f/C/6kg69mOZlDQqVzGMdmW2SndrIgchYtzJ2lfi6KMNlg6TGHMlFp4WsX8km2Hu3Z/mmtMWpEClH1NIiPG5dJUBXIvNJfyIsDQX7jqhz2Ycl5yN4uEEcoPYVhYZqUD3oX0A4E6Q7wawi4SoHw36IBjQ2c8rT6GmxSVNnKFcQMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=GDBJdUGl7ut3UBQgl0OFvF3Wi98f1TK7jsGsz8BnUDfJhop5FSLmp5glauG6SqNW0QedRyickr90KKTVmP3J5ZQR1Qedvzz0/ZcVMDmGALTse0SlzALpYPGZNkB+4Th3xi0QXeCU2nwvm084AZu5IVsToYbJoqcztNn2VdZGBH4= Received: by 10.82.163.13 with SMTP id l13mr522129bue.1175964464216; Sat, 07 Apr 2007 09:47:44 -0700 (PDT) Received: from ibm-se82151.se.ibm.com ( [80.217.194.157]) by mx.google.com with ESMTP id e8sm15785738muf.2007.04.07.09.47.43; Sat, 07 Apr 2007 09:47:43 -0700 (PDT) Message-ID: <4617CB2D.8000508@gmail.com> Date: Sat, 07 Apr 2007 18:47:41 +0200 From: Pawel Worach User-Agent: Thunderbird 2.0pre (X11/20070325) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <20070407120656.GD63916@garage.freebsd.pl> In-Reply-To: <20070407120656.GD63916@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arch@FreeBSD.org Subject: Re: Host ID. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2007 17:27:59 -0000 Pawel Jakub Dawidek wrote: > Hi. > > After initial discussion on IRC, I'd like to propose an addition... > I want to use it with ZFS, but I thought it may be useful in general, so > here it goes: > > I'd like to assign a unique ID to the system on first boot. > > When system starts, /etc/rc.d/hostid script checks if /hostid file > exists, if it doesn't, it creates it via 'uuidgen > /hostid'. > > It will also set kern.hostuuid sysctl to this value and first four bytes > of MD5(kern.hostuuid) will be stored in kern.hostid. It will allow to > use gethostid(3). > > If root file system is read-only, different uuid will be genrated on > each boot. Not sure if anything better can be done here. > > As I said, I think it may be genrally useful. Imagine using it with > magic/variant symlinks, for example. > > Comments? > What about ... # kenv smbios.system.uuid 63F8BC81-475C-11CB-A074-CA3B9005F8F6 Not all systems have SMBIOSen but maybe it can be used instead of /{,etc}/hostid if available ? Regards -- Pawel