about summary refs log tree commit diff
path: root/core-services
diff options
context:
space:
mode:
authorChristopher Brannon <chris@the-brannons.com>2015-11-11 12:14:37 -0800
committerChristopher Brannon <chris@the-brannons.com>2015-11-11 12:28:07 -0800
commit169b0f739fbba866296fc9d30bc463fb522fef69 (patch)
tree69c266c884e4d4b75e2a65ed0e867994bdfba95d /core-services
parent39ae8ddc3c9487369a16016e558800d4dea11ce1 (diff)
downloadrunit-void-169b0f739fbba866296fc9d30bc463fb522fef69.tar.gz
runit-void-169b0f739fbba866296fc9d30bc463fb522fef69.tar.xz
runit-void-169b0f739fbba866296fc9d30bc463fb522fef69.zip
Don't output newline to /proc file when setting hostname.
This breaks in certain combinations of echo command and standard
library, notably musl and bash builtin echo,
or coreutils echo + musl.
Diffstat (limited to 'core-services')
-rw-r--r--core-services/05-misc.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/core-services/05-misc.sh b/core-services/05-misc.sh
index 8f5c6c5..743dcdb 100644
--- a/core-services/05-misc.sh
+++ b/core-services/05-misc.sh
@@ -10,7 +10,7 @@ ip link set up dev lo
 [ -r /etc/hostname ] && read -r HOSTNAME < /etc/hostname
 if [ -n "$HOSTNAME" ]; then
     msg "Setting up hostname to '${HOSTNAME}'..."
-    echo "$HOSTNAME" > /proc/sys/kernel/hostname
+    printf "%s" "$HOSTNAME" > /proc/sys/kernel/hostname
 else
     msg_warn "Didn't setup a hostname!"
 fi