Date: Thu, 12 Jan 2012 15:51:48 -0500 From: Matthew Story <matthewstory@gmail.com> To: Dirk-Willem van Gulik <dirkx@webweaving.org> Cc: freebsd-bugs@freebsd.org, freebsd-gnats-submit@freebsd.org Subject: Re: conf/164048: /etc/rc.d/hostid is not symlink aware Message-ID: <CAB%2B9ogfjxXSo%2B4WRn5FKTXXd=4OD9ofbbKjHshDet2a=MADWDg@mail.gmail.com> In-Reply-To: <32429C77-4BC1-44E3-BAF8-AB5A97058E9B@webweaving.org> References: <201201120815.q0C8FONo062154@red.freebsd.org> <CAB%2B9ogdrZL9znurHyg2=5ST_Szg5aWuGCncSt%2BGtaucknZiikQ@mail.gmail.com> <32429C77-4BC1-44E3-BAF8-AB5A97058E9B@webweaving.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 12, 2012 at 2:47 PM, Dirk-Willem van Gulik <dirkx@webweaving.org > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB%2B9ogfjxXSo%2B4WRn5FKTXXd=4OD9ofbbKjHshDet2a=MADWDg>