From unknown Mon Aug 18 08:26:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6235: hostname and -b option Resent-From: "Nelson H. F. Beebe" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 20 May 2010 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6235 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 6235@debbugs.gnu.org Cc: bowman@math.utah.edu, Brad Hawks , beebe@math.utah.edu X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12743937915078 (code B ref -1); Thu, 20 May 2010 22:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 May 2010 22:16:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2Y-0001Jr-RS for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:31 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2W-0001Jm-21 for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:28 -0400 Received: from lists.gnu.org ([199.232.76.165]:47720) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OFE2S-0008JX-5P for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:24 -0400 Received: from [140.186.70.92] (port=43696 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFE2O-00065j-Vf for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFE2I-00047Y-Jy for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:20 -0400 Received: from mail.math.utah.edu ([155.101.98.135]:59339) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2I-00047K-A4 for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:14 -0400 Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19]) by mail.math.utah.edu (8.14.3/8.14.3) with ESMTP id o4KLj1bq024233; Thu, 20 May 2010 15:45:01 -0600 (MDT) Received: from psi.math.utah.edu (localhost [127.0.0.1]) by psi.math.utah.edu (8.14.3/8.14.3) with ESMTP id o4KLj1pZ008706; Thu, 20 May 2010 15:45:01 -0600 (MDT) Received: (from beebe@localhost) by psi.math.utah.edu (8.14.3/8.14.3/Submit) id o4KLj1fZ008705; Thu, 20 May 2010 15:45:01 -0600 (MDT) Date: Thu, 20 May 2010 15:45:01 -0600 (MDT) From: "Nelson H. F. Beebe" X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT 84112-0090, USA" X-Telephone: +1 801 581 5254 X-FAX: +1 801 585 1640, +1 801 581 4148 X-URL: http://www.math.utah.edu/~beebe Message-ID: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (mail.math.utah.edu [155.101.98.135]); Thu, 20 May 2010 15:45:01 -0600 (MDT) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.8 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) We noticed recently that Ubuntu's /bin/hostname has this option -b, --boot set default hostname if none available and uses it in /etc/init/hostname.conf. However, the GNU version from coreutils-1.8 lacks that option. Unfortunately, Ubuntu's startup script puts /usr/local/bin ahead of /bin and /usr/bin, thus getting a version of hostname that chokes on the -b option. We patched the configuration file to force an explicit path: exec /bin/hostname -b -F /etc/hostname Would it be reasonable to consider adding support in coreutils for the -b option? At my site, I have % cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=9.10 DISTRIB_CODENAME=karmic DISTRIB_DESCRIPTION="Ubuntu 9.10" % uname -r 2.6.31-21-generic-pae % /bin/hostname --version hostname 2.95 [I'm not urging that this be done, merely that it be discussed. In my view, Ubuntu is at fault for introducing nonstandard options, and messing up the boot PATH, and failing to use explicit paths on critical boot-time commands. We had issues a few months ago with GNU inetutils that have since been resolved by adding support in inetutils for an option expected by Ubuntu.] ------------------------------------------------------------------------------- - Nelson H. F. Beebe Tel: +1 801 581 5254 - - University of Utah FAX: +1 801 581 4148 - - Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.edu - - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org - - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ - ------------------------------------------------------------------------------- From unknown Mon Aug 18 08:26:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6235: hostname and -b option Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 20 May 2010 22:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6235 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: "Nelson H. F. Beebe" Cc: 6235@debbugs.gnu.org, bowman@math.utah.edu, Brad Hawks Received: via spool by 6235-submit@debbugs.gnu.org id=B6235.12743947075555 (code B ref 6235); Thu, 20 May 2010 22:32:01 +0000 Received: (at 6235) by debbugs.gnu.org; 20 May 2010 22:31:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFEHL-0001RY-4y for submit@debbugs.gnu.org; Thu, 20 May 2010 18:31:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFEHI-0001RR-HE for 6235@debbugs.gnu.org; Thu, 20 May 2010 18:31:45 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4KMVapJ022345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 May 2010 18:31:36 -0400 Received: from [10.11.8.190] (vpn-8-190.rdu.redhat.com [10.11.8.190]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4KMVXMD008992; Thu, 20 May 2010 18:31:33 -0400 Message-ID: <4BF5B832.8090101@redhat.com> Date: Thu, 20 May 2010 16:31:14 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4 MIME-Version: 1.0 References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE0C72FF64CFC2E93F538BF2B" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Spam-Score: -10.1 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.1 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE0C72FF64CFC2E93F538BF2B Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/20/2010 03:45 PM, Nelson H. F. Beebe wrote: > We noticed recently that Ubuntu's /bin/hostname has this option >=20 > -b, --boot set default hostname if none available >=20 > and uses it in /etc/init/hostname.conf. >=20 > However, the GNU version from coreutils-1.8 lacks that option. coreutils 1.8 doesn't exist. Did you mean coreutils 8.5? >=20 > Unfortunately, Ubuntu's startup script puts /usr/local/bin ahead of > /bin and /usr/bin, thus getting a version of hostname that chokes on > the -b option. We patched the configuration file to force an explicit > path: >=20 > exec /bin/hostname -b -F /etc/hostname Correct - Ubuntu's script is buggy if it uses non-standard options without an explicit path to a version of the utility known to provide those options. >=20 > Would it be reasonable to consider adding support in coreutils for the = -b option? How would we (portably) implement it? The problem is that coreutils' hostname has to compile on many more platforms than just Ubuntu, and there are just too many distro-specific actions (or even lack of OS interfaces altogether) for setting a default hostname. > [I'm not urging that this be done, merely that it be discussed. In my > view, Ubuntu is at fault for introducing nonstandard options, and > messing up the boot PATH, and failing to use explicit paths on > critical boot-time commands. Your view is correct. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigE0C72FF64CFC2E93F538BF2B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJL9bgyAAoJEKeha0olJ0NqJEUH/2SRPTOtmbUl7u6YFi9TCyNW 7XmhkhDCqY7gBX8bNG+N1QneiOukvIaXpfA+T3SxaPL70IoIjm6oEFDeCjg7AmJf Z4RXCD7dR/Z4/CuNzNiajIeeFzEpgfW3zK1Ib1CamK/sBsMsNnknDYUgJuR8Ez4C W7XJl2FcXoPn42Xb/Vj1wNna2DVxeryUEveFAVzwlAK8gUxLh657h7SMveWTtECI FcFwv2hFsPTxn44YLO3alMlZGC/EcWeeWTNZEta9h6rKGPu+d49A+08elaj7ySW6 2HtguOl1YNF0FOy/YOrsdjjrxSj/Vwl801E+y672nFZvvW+CRR5c0sbyFz707ec= =b5E7 -----END PGP SIGNATURE----- --------------enigE0C72FF64CFC2E93F538BF2B-- From unknown Mon Aug 18 08:26:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6235: hostname and -b option Resent-From: C de-Avillez Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 20 May 2010 23:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6235 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 6235@debbugs.gnu.org, bowman@math.utah.edu, "Nelson H. F. Beebe" , Brad Hawks Received: via spool by 6235-submit@debbugs.gnu.org id=B6235.12743976036977 (code B ref 6235); Thu, 20 May 2010 23:21:01 +0000 Received: (at 6235) by debbugs.gnu.org; 20 May 2010 23:20:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFF22-0001oU-89 for submit@debbugs.gnu.org; Thu, 20 May 2010 19:20:02 -0400 Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFEz4-0001mj-4U for 6235@debbugs.gnu.org; Thu, 20 May 2010 19:16:58 -0400 Received: by gwj23 with SMTP id 23so195620gwj.3 for <6235@debbugs.gnu.org>; Thu, 20 May 2010 16:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer; bh=HMu/SFeZpQJmnb6HaB52JT9n2/uAsYYVM9Pk+kHrEgM=; b=kWxlLaPSw0tBl1N1U4FxnRbw7ghm8DY4Wzb2PxMBF5IKJvBmLqEK1Fx5jWQv7sLLqr 05XXVFHDrRxX+eRZoz8+JcrUYy4UZhq47TLdaGmki4LZ4lrZ+VO/E14pLA9hwD6CXjbZ /Bt9cbKY1DnifjJMC3yQAnBAZmBZsWY1MrF4s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer; b=baplYEgrdjaZzpFI6BwVwFf1aplb7rRnaQq2hDM5urRF+vEVww0UJa+jaYotooHSmm HHpRLreIpcpS5Bjifqdwpq6KuoOJlCtn9KasDv43lseZ+FhYezhwmFH/pxQqP3rJRMXg xHATCJ5hjC1hBM+7XYPsxoASd/hbj8ThDQOJs= Received: by 10.150.117.1 with SMTP id p1mr2097069ybc.274.1274397414011; Thu, 20 May 2010 16:16:54 -0700 (PDT) Received: from [192.168.2.152] (pool-71-252-251-234.dllstx.fios.verizon.net [71.252.251.234]) by mx.google.com with ESMTPS id u2sm13827802ybh.15.2010.05.20.16.16.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 May 2010 16:16:53 -0700 (PDT) From: C de-Avillez In-Reply-To: <4BF5B832.8090101@redhat.com> References: <4BF5B832.8090101@redhat.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-1ujuN2lJ0ZlD2zrbqSyV" Date: Thu, 20 May 2010 18:16:50 -0500 Message-ID: <1274397410.3951.11.camel@xango2> Mime-Version: 1.0 X-Mailer: Evolution 2.31.2 X-Spam-Score: -1.1 (-) X-Mailman-Approved-At: Thu, 20 May 2010 19:20:02 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) --=-1ujuN2lJ0ZlD2zrbqSyV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2010-05-20 at 16:31 -0600, Eric Blake wrote: > > Unfortunately, Ubuntu's startup script puts /usr/local/bin ahead of > > /bin and /usr/bin, thus getting a version of hostname that chokes on > > the -b option. We patched the configuration file to force an explicit > > path: > >=20 > > exec /bin/hostname -b -F /etc/hostname >=20 > Correct - Ubuntu's script is buggy if it uses non-standard options > without an explicit path to a version of the utility known to provide > those options. Ubuntu does not install *anything* under /usr/local -- this is a path reserved for local stuff. On Ubuntu, 'hostname' is installed from the hostname package. As such, there are no non-standard options being played. > > [I'm not urging that this be done, merely that it be discussed. In my > > view, Ubuntu is at fault for introducing nonstandard options, and > > messing up the boot PATH, and failing to use explicit paths on > > critical boot-time commands. >=20 > Your view is correct. >=20 I was looking at the coreutils source (git). 'hostname' is set not to be installed by default (together with 'arch' and 'su') -- unless one runs ./configure --instal-program=3Dhostname. I am failing to see how Ubuntu is messing up the boot path; additionally, there is no conflict for 'hostname' unless one installs something outside of the distribution (but, then, all bets are off, anyways). For example, I usually run coreutils git, and have no problems like the OP. Thank you, ..C.. --=-1ujuN2lJ0ZlD2zrbqSyV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEABECAAYFAkv1wt4ACgkQfbrzscpaDCDcxwCg3gnxhcqvgjfXu1CJZpcmAhjl 1J0AniY0loFkQybrawcgZIiQWV6oZ6WL =CWjj -----END PGP SIGNATURE----- --=-1ujuN2lJ0ZlD2zrbqSyV-- From unknown Mon Aug 18 08:26:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6235: hostname and -b option Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 21 May 2010 00:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6235 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: Cc: 6235@debbugs.gnu.org, bowman@math.utah.edu, "Nelson H. F. Beebe" , Brad Hawks Received: via spool by 6235-submit@debbugs.gnu.org id=B6235.12744014168700 (code B ref 6235); Fri, 21 May 2010 00:24:01 +0000 Received: (at 6235) by debbugs.gnu.org; 21 May 2010 00:23:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFG1X-0002GH-IL for submit@debbugs.gnu.org; Thu, 20 May 2010 20:23:35 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFG1V-0002GB-U2 for 6235@debbugs.gnu.org; Thu, 20 May 2010 20:23:34 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id B418521378; Thu, 20 May 2010 18:23:29 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id AC8303CC39F; Thu, 20 May 2010 18:23:29 -0600 (MDT) Date: Thu, 20 May 2010 18:23:29 -0600 From: Bob Proulx Message-ID: <20100521002329.GA10806@dementia.proulx.com> References: <4BF5B832.8090101@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BF5B832.8090101@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) Eric Blake wrote: > Nelson H. F. Beebe wrote: > > We noticed recently that Ubuntu's /bin/hostname has this option > > -b, --boot set default hostname if none available The longer documentation (from Debian Sid) is: -b, --boot Always set a hostname; this allows the file specified by -F to be non-existant or empty, in which case the default hostname localhost will be used if none is yet set. But note that Debian doesn't call hostname with -b or other nonstandard argument. I didn't actually test this (by installing GNU hostname in /usr/local/bin/hostname and rebooting) but came to this conclusion by inspection. I could be wrong. :-) > > Unfortunately, Ubuntu's startup script puts /usr/local/bin ahead of > > /bin and /usr/bin, For userland uses of PATH I think it is well and good to put /usr/local/bin in front of /usr/bin:/bin. It allows the local site admin to install a different executable in /usr/local/bin that will be used. But not if they have created an incompatible API. For system startup scripts that need to restrict operation to the system then system startup scripts should have PATH set to just the system directories and not including site local directories. (Sometimes that means just /sbin:/bin if the script is running before /usr is mounted.) > > thus getting a version of hostname that chokes on > > the -b option. We patched the configuration file to force an explicit > > path: > > > > exec /bin/hostname -b -F /etc/hostname > > Correct - Ubuntu's script is buggy if it uses non-standard options > without an explicit path to a version of the utility known to provide > those options. I agree. If Ubuntu is using an incompatible API in the startup script then they need to ensure that they are calling their own version of the command. But even if they did that just feels like the wrong way to do things. Instead they should use standard scripting to accomplish what they want. Then they could use any hostname implementation. Plus this is already a solved problem. Here is what Debian uses: [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)" # Keep current name if /etc/hostname is missing. [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)" # And set it to 'localhost' if no setting was found [ -z "$HOSTNAME" ] && HOSTNAME=localhost hostname "$HOSTNAME" I am guessing that someone didn't like this scripting, read the documentation for the hostname in use, saw that it supported the -b and -F options and switched to using it without realizing the full consequences of the change. I don't have access to an Ubuntu system at the moment to go check out the full story. > > Would it be reasonable to consider adding support in coreutils for > > the -b option? When the behavior isn't traditional and is also so easily implemented as desired by a line or two of shell script I vote against adding it to the command. > How would we (portably) implement it? The problem is that coreutils' > hostname has to compile on many more platforms than just Ubuntu, and > there are just too many distro-specific actions (or even lack of OS > interfaces altogether) for setting a default hostname. Unfortunately with the description Nelson originally provided it read as if this was setting something distro specific. But actually the -F option just reads the hostname from a file. hostname -F /etc/filename <=> hostname "$(cat /etc/filename)" And the -b option just says to ignore an error if the file is empty or does not exist, in which case set it to localhost. hostname -b -F /etc/filename <=> test -f /etc/hostname && HOSTNAME=$(cat /etc/hostname) test -z "$HOSTNAME" && HOSTNAME=$(hostname) test -z "$HOSTNAME" && HOSTNAME=localhost hostname "$HOSTNAME" Sure that can be put in the executable. But why? > > [I'm not urging that this be done, merely that it be discussed. In my > > view, Ubuntu is at fault for introducing nonstandard options, and > > messing up the boot PATH, and failing to use explicit paths on > > critical boot-time commands. If you are using Ubuntu and have been affected by this change then I suggest filing a bug report against the scripts in question and requesting that they revert this change. I would file it against the scripts that are calling hostname this way and not the hostname they are using. I assume it was a recent script change. I also suggest looking at the package history and seeing when this modification occurred. In which case you would have better leverage that it is something to be reverted. You could also note that Debian doesn't do it that way. :-) However your easiest path is to not install GNU hostname in /usr/local/bin at all. It shouldn't be getting installed by a default build and install. You must have enabled it. It would be much simpler to not and not use it. Bob From unknown Mon Aug 18 08:26:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6235: hostname and -b option Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 07 Jun 2010 23:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6235 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: "Nelson H. F. Beebe" , 6235@debbugs.gnu.org Cc: bowman@math.utah.edu, Brad Hawks Received: via spool by 6235-submit@debbugs.gnu.org id=B6235.127595472823334 (code B ref 6235); Mon, 07 Jun 2010 23:53:02 +0000 Received: (at 6235) by debbugs.gnu.org; 7 Jun 2010 23:52:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLm6x-00064I-PF for submit@debbugs.gnu.org; Mon, 07 Jun 2010 19:52:07 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLm6v-00063w-PW for 6235@debbugs.gnu.org; Mon, 07 Jun 2010 19:52:06 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id A797221362; Mon, 7 Jun 2010 17:52:01 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id 9EFAF3CD899; Mon, 7 Jun 2010 17:52:01 -0600 (MDT) Date: Mon, 7 Jun 2010 17:52:01 -0600 From: Bob Proulx Message-ID: <20100607235201.GH585@dementia.proulx.com> References: <4BF5B832.8090101@redhat.com> <20100521002329.GA10806@dementia.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100521002329.GA10806@dementia.proulx.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) Hi Nelson, Have there been any new developments with this issue? Note that the BTS is tracking it here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6235 Bob From unknown Mon Aug 18 08:26:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Nelson H. F. Beebe" Subject: bug#6235: closed (Re: bug#6235: hostname and -b option) Message-ID: References: <20110825053320.GA26301@hysteria.proulx.com> X-Gnu-PR-Message: they-closed 6235 X-Gnu-PR-Package: coreutils Reply-To: 6235@debbugs.gnu.org Date: Thu, 25 Aug 2011 05:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1314250622-14260-1" This is a multi-part message in MIME format... ------------=_1314250622-14260-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6235: hostname and -b option which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6235@debbugs.gnu.org. --=20 6235: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6235 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1314250622-14260-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6235-done) by debbugs.gnu.org; 25 Aug 2011 05:36:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwSbh-0003gM-B1 for submit@debbugs.gnu.org; Thu, 25 Aug 2011 01:36:01 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwSbe-0003gB-Fb for 6235-done@debbugs.gnu.org; Thu, 25 Aug 2011 01:35:59 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 75A9921311; Wed, 24 Aug 2011 23:33:20 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 2C28349912; Wed, 24 Aug 2011 23:33:20 -0600 (MDT) Date: Wed, 24 Aug 2011 23:33:20 -0600 From: Bob Proulx To: "Nelson H. F. Beebe" , 6235-done@debbugs.gnu.org Subject: Re: bug#6235: hostname and -b option Message-ID: <20110825053320.GA26301@hysteria.proulx.com> References: <4BF5B832.8090101@redhat.com> <20100521002329.GA10806@dementia.proulx.com> <20100607235201.GH585@dementia.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100607235201.GH585@dementia.proulx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 6235-done Cc: bowman@math.utah.edu, Brad Hawks X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > Have there been any new developments with this issue? > Note that the BTS is tracking it here: > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6235 It has been a year since any feedback has been provided on this issue in the bug tracking system. I assume that the discussion logged so far was sufficient. Therefore I am closing this bug. If you have more information for it that is great. It is okay with me if you wish to re-open the bug. Bob ------------=_1314250622-14260-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 May 2010 22:16:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2Y-0001Jr-RS for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:31 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2W-0001Jm-21 for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:28 -0400 Received: from lists.gnu.org ([199.232.76.165]:47720) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OFE2S-0008JX-5P for submit@debbugs.gnu.org; Thu, 20 May 2010 18:16:24 -0400 Received: from [140.186.70.92] (port=43696 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFE2O-00065j-Vf for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFE2I-00047Y-Jy for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:20 -0400 Received: from mail.math.utah.edu ([155.101.98.135]:59339) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFE2I-00047K-A4 for bug-coreutils@gnu.org; Thu, 20 May 2010 18:16:14 -0400 Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19]) by mail.math.utah.edu (8.14.3/8.14.3) with ESMTP id o4KLj1bq024233; Thu, 20 May 2010 15:45:01 -0600 (MDT) Received: from psi.math.utah.edu (localhost [127.0.0.1]) by psi.math.utah.edu (8.14.3/8.14.3) with ESMTP id o4KLj1pZ008706; Thu, 20 May 2010 15:45:01 -0600 (MDT) Received: (from beebe@localhost) by psi.math.utah.edu (8.14.3/8.14.3/Submit) id o4KLj1fZ008705; Thu, 20 May 2010 15:45:01 -0600 (MDT) Date: Thu, 20 May 2010 15:45:01 -0600 (MDT) From: "Nelson H. F. Beebe" To: bug-coreutils@gnu.org X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT 84112-0090, USA" X-Telephone: +1 801 581 5254 X-FAX: +1 801 585 1640, +1 801 581 4148 X-URL: http://www.math.utah.edu/~beebe Subject: hostname and -b option Message-ID: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (mail.math.utah.edu [155.101.98.135]); Thu, 20 May 2010 15:45:01 -0600 (MDT) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit Cc: bowman@math.utah.edu, Brad Hawks , beebe@math.utah.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) We noticed recently that Ubuntu's /bin/hostname has this option -b, --boot set default hostname if none available and uses it in /etc/init/hostname.conf. However, the GNU version from coreutils-1.8 lacks that option. Unfortunately, Ubuntu's startup script puts /usr/local/bin ahead of /bin and /usr/bin, thus getting a version of hostname that chokes on the -b option. We patched the configuration file to force an explicit path: exec /bin/hostname -b -F /etc/hostname Would it be reasonable to consider adding support in coreutils for the -b option? At my site, I have % cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=9.10 DISTRIB_CODENAME=karmic DISTRIB_DESCRIPTION="Ubuntu 9.10" % uname -r 2.6.31-21-generic-pae % /bin/hostname --version hostname 2.95 [I'm not urging that this be done, merely that it be discussed. In my view, Ubuntu is at fault for introducing nonstandard options, and messing up the boot PATH, and failing to use explicit paths on critical boot-time commands. We had issues a few months ago with GNU inetutils that have since been resolved by adding support in inetutils for an option expected by Ubuntu.] ------------------------------------------------------------------------------- - Nelson H. F. Beebe Tel: +1 801 581 5254 - - University of Utah FAX: +1 801 581 4148 - - Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.edu - - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org - - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ - ------------------------------------------------------------------------------- ------------=_1314250622-14260-1--