Repository: spark
Updated Branches:
  refs/heads/master 7178c5643 -> 625fdddac


[SPARK-17944][DEPLOY] sbin/start-* scripts use of `hostname -f` fail with 
Solaris

## What changes were proposed in this pull request?

Modify sbin/start-master.sh, sbin/start-mesos-dispatcher.sh and 
sbin/start-slaves.sh to use the output of 'uname' to select which OS-specific 
command-line is used to determine the host's fully qualified host name.

## How was this patch tested?

Tested by hand; starting on Solaris, Linux and macOS.

Author: Erik O'Shaughnessy <erik.oshaughne...@gmail.com>

Closes #15557 from JnyJny/SPARK-17944.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/625fddda
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/625fddda
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/625fddda

Branch: refs/heads/master
Commit: 625fdddacd58ad54fdbb17409987812176abc812
Parents: 7178c56
Author: Erik O'Shaughnessy <erik.oshaughne...@gmail.com>
Authored: Sat Oct 22 09:37:53 2016 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Sat Oct 22 09:37:53 2016 +0100

----------------------------------------------------------------------
 sbin/start-master.sh           | 9 ++++++++-
 sbin/start-mesos-dispatcher.sh | 9 ++++++++-
 sbin/start-slaves.sh           | 9 ++++++++-
 3 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/625fddda/sbin/start-master.sh
----------------------------------------------------------------------
diff --git a/sbin/start-master.sh b/sbin/start-master.sh
index d970fcc..97ee321 100755
--- a/sbin/start-master.sh
+++ b/sbin/start-master.sh
@@ -48,7 +48,14 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
 fi
 
 if [ "$SPARK_MASTER_HOST" = "" ]; then
-  SPARK_MASTER_HOST=`hostname -f`
+  case `uname` in
+      (SunOS)
+         SPARK_MASTER_HOST="`/usr/sbin/check-hostname | awk '{print $NF}'`"
+         ;;
+      (*)
+         SPARK_MASTER_HOST="`hostname -f`"
+         ;;
+  esac
 fi
 
 if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then

http://git-wip-us.apache.org/repos/asf/spark/blob/625fddda/sbin/start-mesos-dispatcher.sh
----------------------------------------------------------------------
diff --git a/sbin/start-mesos-dispatcher.sh b/sbin/start-mesos-dispatcher.sh
index ef65fb9..ecaad7a 100755
--- a/sbin/start-mesos-dispatcher.sh
+++ b/sbin/start-mesos-dispatcher.sh
@@ -34,7 +34,14 @@ if [ "$SPARK_MESOS_DISPATCHER_PORT" = "" ]; then
 fi
 
 if [ "$SPARK_MESOS_DISPATCHER_HOST" = "" ]; then
-  SPARK_MESOS_DISPATCHER_HOST=`hostname -f`
+  case `uname` in
+      (SunOS)
+         SPARK_MESOS_DISPATCHER_HOST="`/usr/sbin/check-hostname | awk '{print 
$NF}'`"
+         ;;
+      (*)
+         SPARK_MESOS_DISPATCHER_HOST="`hostname -f`"
+         ;;
+  esac
 fi
 
 if [ "$SPARK_MESOS_DISPATCHER_NUM" = "" ]; then

http://git-wip-us.apache.org/repos/asf/spark/blob/625fddda/sbin/start-slaves.sh
----------------------------------------------------------------------
diff --git a/sbin/start-slaves.sh b/sbin/start-slaves.sh
index 7d88712..f5269df 100755
--- a/sbin/start-slaves.sh
+++ b/sbin/start-slaves.sh
@@ -32,7 +32,14 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
 fi
 
 if [ "$SPARK_MASTER_HOST" = "" ]; then
-  SPARK_MASTER_HOST="`hostname -f`"
+  case `uname` in
+      (SunOS)
+         SPARK_MASTER_HOST="`/usr/sbin/check-hostname | awk '{print $NF}'`"
+         ;;
+      (*)
+         SPARK_MASTER_HOST="`hostname -f`"
+         ;;
+  esac
 fi
 
 # Launch the slaves


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to