From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 12 20:51:49 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E75BB106566C; Thu, 12 Jan 2012 20:51:49 +0000 (UTC) (envelope-from matthewstory@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0E78FC1D; Thu, 12 Jan 2012 20:51:49 +0000 (UTC) Received: by vbbfp1 with SMTP id fp1so1141967vbb.13 for ; Thu, 12 Jan 2012 12:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MPK4kBhKD5Ki3BjYUuQF2yzMZ2FzswvnxzQjy9TSu0Y=; b=AdpPQgeUymnOpYjiaB8fyTJs06NsBDrBw0kCdyCE2r4IarL72kC+i+2qXHE2cAlSCL zDURyc+HQITV7oCryH5qS9VQXt3On/T+DBlfz/0JEl1ZXdRidTYrSkUirTE0qbJ/k+tr rGY4ayo/cG1W7xd8CdmCVtffdhRg+NN8TWEbE= MIME-Version: 1.0 Received: by 10.52.90.202 with SMTP id by10mr2393856vdb.104.1326401508915; Thu, 12 Jan 2012 12:51:48 -0800 (PST) Received: by 10.52.159.69 with HTTP; Thu, 12 Jan 2012 12:51:48 -0800 (PST) In-Reply-To: <32429C77-4BC1-44E3-BAF8-AB5A97058E9B@webweaving.org> References: <201201120815.q0C8FONo062154@red.freebsd.org> <32429C77-4BC1-44E3-BAF8-AB5A97058E9B@webweaving.org> Date: Thu, 12 Jan 2012 15:51:48 -0500 Message-ID: From: Matthew Story To: Dirk-Willem van Gulik Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bugs@freebsd.org, freebsd-gnats-submit@freebsd.org Subject: Re: conf/164048: /etc/rc.d/hostid is not symlink aware X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 20:51:50 -0000 On Thu, Jan 12, 2012 at 2:47 PM, Dirk-Willem van Gulik wrote: > > On 12 jan. 2012, at 17:48, Matthew Story wrote: > > > On Thu, Jan 12, 2012 at 3:15 AM, Dirk-Willem van Gulik < > dirkx@webweaving.org> wrote: > [...snip] > Totally understood - but wanted to stay close to the behavior of > dhclient-script as I understand it. And this happens to also make the > behavior of /etc/rc.d/sshd on first run the same. Keep in mind that one can > always set the rc variable. > it makes sense to test for existence (and not readability) for rc.d/sshd, as it goes on to create files if they do not exist: if [ -f /etc/ssh/ssh_host_key ]; then echo "You already have an RSA host key" \ "in /etc/ssh/ssh_host_key" echo "Skipping protocol version 1 RSA Key Generation" else /usr/bin/ssh-keygen -t rsa1 -b 1024 \ -f /etc/ssh/ssh_host_key -N '' fi in the existing implementation of rc.d/hostid, it does not create the file on ``start'' if it does not exist, so detection of readability is more correct (although in the typical use-case e.g. running as root, existence and readability are ostensibly synonymous). > [...snip] > > Agreed - as _set is better. > [...snip] > So the question is not about respecting symlinks, but wether or not a ``host_id_file'' should be created if one does not exist, for the ``start'' command. I'm not sure if this behavior is desirable, considering that the de facto behavior is to respect hardware derived ``smbios.system.uuid'', and writing that value to disk would potentially require an additional reset on hardware change. As you can easily generate a ``host_id_file'' if one does not exist by invoking the ``reset'' command, and the sysctl is set at start properly, either from ``host_id_file'', hardware or via the ``uuidgen'' program, this seems superfluous to me ... but I defer to the maintainer. -- regards, matt