~alpine/aports

main/openrc: fix hostname init for btrfs subvolumes v1 PROPOSED

Stuart Cardall: 1
 main/openrc: fix hostname init for btrfs subvolumes

 1 files changed, 1 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/1715/mbox | git am -3
Learn more about email & git

[alpine-aports] [PATCH] main/openrc: fix hostname init for btrfs subvolumes Export this patch

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
---