diff options
author | Erik O'Shaughnessy <erik.oshaughnessy@gmail.com> | 2016-10-22 09:37:53 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-10-22 09:37:53 +0100 |
commit | 625fdddacd58ad54fdbb17409987812176abc812 (patch) | |
tree | cc19726d0e5ba7000e0eec718ddf1876f6efa2f3 /sbin/start-mesos-dispatcher.sh | |
parent | 7178c56433cd138dae53db9194c55e3f4fa0fa69 (diff) | |
download | spark-625fdddacd58ad54fdbb17409987812176abc812.tar.gz spark-625fdddacd58ad54fdbb17409987812176abc812.tar.bz2 spark-625fdddacd58ad54fdbb17409987812176abc812.zip |
[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.oshaughnessy@gmail.com>
Closes #15557 from JnyJny/SPARK-17944.
Diffstat (limited to 'sbin/start-mesos-dispatcher.sh')
-rwxr-xr-x | sbin/start-mesos-dispatcher.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/start-mesos-dispatcher.sh b/sbin/start-mesos-dispatcher.sh index ef65fb9539..ecaad7ad09 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 |