aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKarthikTunga <karthik.tunga@gmail.com>2013-10-16 22:51:09 -0700
committerKarthikTunga <karthik.tunga@gmail.com>2013-10-16 22:51:09 -0700
commita32aa6b351064f17779adcd8e89ebc0e98fc3096 (patch)
tree6b51550700929a885495cca0039615e77ab04482 /bin
parent6c6b146fc20f2ba85f1cf1bb9e35283ee195f59a (diff)
downloadspark-a32aa6b351064f17779adcd8e89ebc0e98fc3096.tar.gz
spark-a32aa6b351064f17779adcd8e89ebc0e98fc3096.tar.bz2
spark-a32aa6b351064f17779adcd8e89ebc0e98fc3096.zip
Implementing --config argument in the scripts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/slaves.sh7
-rwxr-xr-xbin/spark-daemon.sh10
2 files changed, 10 insertions, 7 deletions
diff --git a/bin/slaves.sh b/bin/slaves.sh
index bcb7760130..aeb0c0f6be 100755
--- a/bin/slaves.sh
+++ b/bin/slaves.sh
@@ -28,7 +28,7 @@
# SPARK_SSH_OPTS Options passed to ssh when running remote commands.
##
-usage="Usage: slaves.sh [--config confdir] command..."
+usage="Usage: slaves.sh [--config <conf-dir>] command..."
# if no args specified, show usage
if [ $# -le 0 ]; then
@@ -46,14 +46,15 @@ bin=`cd "$bin"; pwd`
# spark-env.sh. Save it here.
HOSTLIST=$SPARK_SLAVES
-#check if conf dir passed as an argument
+# Check if --config is passed as an argument. It is an optional parameter.
+# Exit if the argument is a directory.
if [ "$1" == "--config" ]
then
shift
conf_dir=$1
if [ ! -d "$conf_dir" ]
then
- echo "$conf_dir is not a valid directory"
+ echo "ERROR : $conf_dir is not a directory"
echo $usage
exit 1
else
diff --git a/bin/spark-daemon.sh b/bin/spark-daemon.sh
index 48d552f3db..262ef173be 100755
--- a/bin/spark-daemon.sh
+++ b/bin/spark-daemon.sh
@@ -29,7 +29,7 @@
# SPARK_NICENESS The scheduling priority for daemons. Defaults to 0.
##
-usage="Usage: spark-daemon.sh [--config <conf-dir>] [--hosts hostlistfile] (start|stop) <spark-command> <spark-instance-number> <args...>"
+usage="Usage: spark-daemon.sh [--config <conf-dir>] (start|stop) <spark-command> <spark-instance-number> <args...>"
# if no args specified, show usage
if [ $# -le 1 ]; then
@@ -44,15 +44,17 @@ bin=`cd "$bin"; pwd`
# get arguments
-# check if conf dir passed as an argument
+# Check if --config is passed as an argument. It is an optional parameter.
+# Exit if the argument is a directory.
+
if [ "$1" == "--config" ]
then
shift
conf_dir=$1
if [ ! -d "$conf_dir" ]
then
- echo "$conf_dir is not a valid directory"
- echo "FOUL :"$usage
+ echo "ERROR : $conf_dir is not a directory"
+ echo $usage
exit 1
else
export SPARK_CONF_DIR=$conf_dir