From owner-freebsd-arch@FreeBSD.ORG Sat Apr 7 13:35:26 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 6114B16A403 for ; Sat, 7 Apr 2007 13:35:26 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.232]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF4413C480 for ; Sat, 7 Apr 2007 13:35:25 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: by nz-out-0506.google.com with SMTP id r28so723231nza for ; Sat, 07 Apr 2007 06:35:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=kxYRGMGgG6LYpeJcXChDl15Bp9vAGYs7p80WqSi9mMMpdxvdxGzjYlwBH98pVydmzcaHK6ilrgMB2Dpc+uh9fyL/ssH8H90AgKf9YS22rMe20scp/IWP5sQtIqFFLiBo8B0WSI7hb8yNJIKwX5XPpk0jO9riJvDBH4HXHyzQkDA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HqX6dUhsFjWuycDSR7B8uNZJwc6fn14f1XnyezZyipouD9lhM4U97Y6rXgH3tUjx7799aJv4Ng8a2TnI8zFbliuZp6gvsmALLuau0wYn9xSgyRDU9+NBZgBA6U1uCAKvRF4j0b6djCfp1rA7h6sw7BIkPb5wJ4Wr3IjJSUWSOcw= Received: by 10.115.46.9 with SMTP id y9mr1607582waj.1175951245112; Sat, 07 Apr 2007 06:07:25 -0700 (PDT) Received: by 10.114.201.2 with HTTP; Sat, 7 Apr 2007 06:07:25 -0700 (PDT) Message-ID: Date: Sat, 7 Apr 2007 17:07:25 +0400 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: "Pawel Jakub Dawidek" In-Reply-To: <20070407120656.GD63916@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070407120656.GD63916@garage.freebsd.pl> X-Google-Sender-Auth: bd2348c6f73ec192 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 13:35:26 -0000 On 4/7/07, 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. Just random thoughts: - It sounds more like a (writeable) root fs ID... - Is Windows-style hardware ID's hashing totally ruled out? - How does it work in other OS'es? (e.g. solaris /bin/hostid) Anyway, it would be a nice feature. It can be leveraged in many cases. Thanks!