X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 7F2D8DC098F for ; Sun, 15 Nov 2015 01:43:01 +0000 (UTC) Received: from apollo.thewebhostserver.com (unknown [46.28.50.181]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 3E591DC03C0 for ; Sun, 15 Nov 2015 01:42:59 +0000 (UTC) Received: from [81.4.121.188] (port=56373 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.86) (envelope-from ) id 1ZxmLH-0029Sw-V1; Sun, 15 Nov 2015 01:42:56 +0000 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH] main/openrc: fix hostname init for btrfs subvolumes Date: Sun, 15 Nov 2015 01:43:09 +0000 Message-Id: <1447551789-21436-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.6.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Busybox hostname doesn't seem to work on btrfs subvolumes (the hostname is set as "?") This shell oneliner sets the hostname as the first non blank line in /etc/hostname. If /etc/hostname is empty or does not exist the hostname is set to localhost. --- main/openrc/hostname.initd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/main/openrc/hostname.initd b/main/openrc/hostname.initd index fdc7f0b..49098f4 100644 --- a/main/openrc/hostname.initd +++ b/main/openrc/hostname.initd @@ -7,11 +7,7 @@ depend() { } start() { - if [ -f /etc/hostname ] ; then - opts="-F /etc/hostname" - else - opts="localhost" - fi + opts="$(grep -v '^$' /etc/hostname)" 2>/dev/null || opts="localhost" ebegin "Setting hostname" hostname $opts eend $? -- 2.6.3 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---