[Lunar-commits] <lunar-tools> lnet: set hostname manually when running in the lunar installer

Stefan Wold ratler at lunar-linux.org
Sat Sep 13 12:38:21 CEST 2014


commit 842b6d7fb6758e189a9f6b456f8d5d2d728e61f8
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Sat, 13 Sep 2014 12:31:20 +0200
URL: https://github.com/lunar-linux/lunar-tools/commit/842b6d7fb6758e189a9f6b456f8d5d2d728e61f8

lnet: set hostname manually when running in the lunar installer
---
  prog/lnet | +6/-1     
  1 file changed, 6 insertions(+), 1 deletion(-)

--- a/prog/lnet
+++ b/prog/lnet
@@ -220,7 +220,12 @@ function hostname_config()
    # Assume systemd is running
    if [ -n "$SYSTEMDUNITDIR" ]; then
      clear
-     hostnamectl set-hostname "$HOSTNAME"
+     # We can't access dbus during installation thus we manually set hostname
+     if [[ -n "$LUNAR_INSTALL" && -n "$HOSTNAME" ]]; then
+       echo "$HOSTNAME" > /etc/hostname
+     else
+       hostnamectl set-hostname "$HOSTNAME"
+     fi
    else
      if [ -n "$HOSTNAME" ]; then
        echo "$HOSTNAME" > /etc/hostname




More information about the Lunar-commits mailing list