Subject: [alpine-aports] [PATCH v2] main/openrc: fix hostname init

From: Stuart Cardall <[email-masked]>
Date: Mon, 14 Dec 2015 21:36:44 +0000

prevents a hostname of "?" if /etc/hostname is empty
---
 main/openrc/APKBUILD       | 6 +++---
 main/openrc/hostname.initd | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD
index c2ba6df..4ce5ec0 100644
--- a/main/openrc/APKBUILD
+++ b/main/openrc/APKBUILD
@@ -84,7 +84,7 @@ c2af5e52da614a6cef02d1e4d537e360  swap-umount-tmpfs.patch
 679c559aa54f9e855cd735866eeaaad6  hide-migrate-to-run-error.patch
 db45dc04a50d48a0c377e9de3ee0008b  rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch
 d83df5513f08f09fa9e7353327701bf7  openrc.logrotate
-2c9cf86959b9e51e662036b4e716617e  hostname.initd
+60b4cf93ca19aff577fd743ab42878a8  hostname.initd
 887eba592d487d6ffe2b42cfcd2813df  hwdrivers.initd
 41974f5408fd2e92892f891b58f2e49f  keymaps.initd
 0ece77eff8f163b36f6f0e7a6d422866  modules.initd
@@ -102,7 +102,7 @@ bdccc12593d9bb9df6fcff57a56e4100ae43e052d6eff87f561966653ca071dc  0001-sysctl.Li
 786580df90a5a75087e5adfd395d160dee2df4b994e0938e8524198aeaf2d774  hide-migrate-to-run-error.patch
 cb4ff88875c0125b68fe567cc41b42743499bbdc90a5c9dfe2b92883b5b05111  rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch
 30a81fb2f761083088d4d6a3d435fc842966d44588e9837b45ffd03e48be6eb6  openrc.logrotate
-e23db45e9399dab96d6c922af6c0cd6c243bbcc43756c845b70a9c7222a96313  hostname.initd
+dda515d7d906cebcf4137746939f3fdccc7f504fe097ef1dbf429e3e6773a013  hostname.initd
 6cb4d9ea3ad562bcf2697f61f5a76a10481d23f5dead570f82eff576eaca5236  hwdrivers.initd
 32562d39ade4092df8163c2e8cf0b31eeec06aa5713d343e1c487bfa6d9f7c84  keymaps.initd
 a145636e84547d76b8a188a94c0a76fcc266cd0f486be6cf24d2d74f03038118  modules.initd
@@ -120,7 +120,7 @@ c5b8806c693b0ea48ff87e0e3669304f5c2f95954ad54814889047a933f367081a8c8d3bb771dd1e
 750e3305913d3f6fa6baa0b34b851fe17aacb922e864b95ec9b4b451e8e3c16d0c10686a12f4c7cb9b5d05894e1d89b0dac3beed19b1223d3fbc672f25769145  hide-migrate-to-run-error.patch
 a3c2f419a3d475519cc8f78bd3baa26cae90a492a5fc92308b18931889db10452aa33324cca8489058d2bcf720e67ab9163ada090d3d3f54ab55dbd758901d4a  rc-pull-in-sysinit-and-boot-as-stacked-levels-when-needed.patch
 12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec  openrc.logrotate
-a6e2b44dd548a2470971a44b61ddaaec037438050fe3411b4ea3fe5d36e9ad4cf5b5e226f8d4aacb8f3a4535bb3f2090608275abd76a30de33eb3fadaefad5fd  hostname.initd
+99b542c0903ad6874b8c308b2e0660a4fe2ff9db962dfec65325cd12c368873a2ae800d5e6d42dc4deff775e1d5c0068869eb72581f7ab16e88d5738afe1d3dd  hostname.initd
 b51d95df7b692aaea3e14ed009d99b46b82500d505e2eeecb6a20136cee140aea4a7377a65ccc5c51fff64be7a50666be48616d179888eaeff9d35178a7a772b  hwdrivers.initd
 584ecbbcecb284527d7616790b6e337ace610e4b3cedf2993eca294bfbef54674aeaee3078b6c17d746a0c48b5a64a813c3534136915947e6f62a6fa206cd3ca  keymaps.initd
 7702e2704e4bcfad7c0736eec4cb0e8b20a685851afb5bd9022c5056ea78b8598a9402bae9644ae3268e2ff1c566e147cbb8d00e143491841682e4125fde2a75  modules.initd
diff --git a/main/openrc/hostname.initd b/main/openrc/hostname.initd
index fdc7f0b..c1580db 100644
--- a/main/openrc/hostname.initd
+++ b/main/openrc/hostname.initd
@@ -7,7 +7,7 @@ depend() {
 }
 
 start() {
-	if [ -f /etc/hostname ] ; then
+	if [ -s /etc/hostname ] ; then
 		opts="-F /etc/hostname"
 	else
 		opts="localhost"
-- 
2.6.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---