aboutsummaryrefslogtreecommitdiff
path: root/bin/spark-daemon.sh
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2013-08-02 16:58:19 -0700
committerPatrick Wendell <pwendell@gmail.com>2013-08-02 16:58:19 -0700
commitb4905c383bf24143966d8b2d0ae69ef9ee7c3b0e (patch)
tree033b2558dfe27ffa966e917f0b7f9c132799981a /bin/spark-daemon.sh
parent9d7dfd2d5a28c3e329fe14cf10f5184af1263dd6 (diff)
downloadspark-b4905c383bf24143966d8b2d0ae69ef9ee7c3b0e.tar.gz
spark-b4905c383bf24143966d8b2d0ae69ef9ee7c3b0e.tar.bz2
spark-b4905c383bf24143966d8b2d0ae69ef9ee7c3b0e.zip
Log the launch command for Spark daemons
For debugging and analysis purposes, it's nice to have the exact command used to launch Spark contained within the logs. This adds the necessary hooks to make that possible.
Diffstat (limited to 'bin/spark-daemon.sh')
-rwxr-xr-xbin/spark-daemon.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/spark-daemon.sh b/bin/spark-daemon.sh
index a5b88ca785..96c71e66ca 100755
--- a/bin/spark-daemon.sh
+++ b/bin/spark-daemon.sh
@@ -75,6 +75,8 @@ if [ "$SPARK_IDENT_STRING" = "" ]; then
export SPARK_IDENT_STRING="$USER"
fi
+export SPARK_PRINT_LAUNCH_COMMAND="1"
+
# get log directory
if [ "$SPARK_LOG_DIR" = "" ]; then
export SPARK_LOG_DIR="$SPARK_HOME/logs"
@@ -124,8 +126,9 @@ case $startStop in
spark_rotate_log $log
echo starting $command, logging to $log
+ echo "Spark Daemon: $command" > $log
cd "$SPARK_PREFIX"
- nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/run $command "$@" > "$log" 2>&1 < /dev/null &
+ nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/run $command "$@" >> "$log" 2>&1 < /dev/null &
echo $! > $pid
sleep 1; head "$log"
;;