From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C916B138331 for ; Wed, 24 Aug 2016 18:49:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8A3B6E0B79; Wed, 24 Aug 2016 18:49:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF0CEE0B81 for ; Wed, 24 Aug 2016 18:49:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 83797340988 for ; Wed, 24 Aug 2016 18:49:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4D4D32466 for ; Wed, 24 Aug 2016 18:49:10 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1472064191.4018dfc8de4818101c336ff8bcf0f4762b318c6a.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/hostname.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 4018dfc8de4818101c336ff8bcf0f4762b318c6a X-VCS-Branch: master Date: Wed, 24 Aug 2016 18:49:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7ca219e9-6a43-4aba-a145-71ff930463f5 X-Archives-Hash: 44fbeced709a5ee304a803ef3a79c51b commit: 4018dfc8de4818101c336ff8bcf0f4762b318c6a Author: William Hubbs gmail com> AuthorDate: Wed Aug 24 18:43:11 2016 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Aug 24 18:43:11 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=4018dfc8 init.d/hostname: do not use localhost as a default hostname This allows the operating system default hostname to be used if no hostname is configured. init.d/hostname.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.d/hostname.in b/init.d/hostname.in index 74866b4..253d338 100644 --- a/init.d/hostname.in +++ b/init.d/hostname.in @@ -24,7 +24,11 @@ start() else # HOSTNAME variable used to be defined in caps in conf.d/hostname. # It is also a magic variable in bash. - h=${hostname-${HOSTNAME-localhost}} # checkbashisms: false positive + h=${hostname-${HOSTNAME}} # checkbashisms: false positive + fi + if [ -z "$h" ]; then + einfo "Using default system hostname" + return 0 fi ebegin "Setting hostname to $h $source" hostname "$h"