Skip to content

Commit

Permalink
HADOOP-16276. Fix jsvc startup command in hadoop-functions.sh due to …
Browse files Browse the repository at this point in the history
…jsvc >= 1.0.11 changed default current working directory (apache#1272)
  • Loading branch information
smengcl authored and RogPodge committed Mar 25, 2020
1 parent 832ddb3 commit 2f4702f
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,22 @@ function hadoop_start_secure_daemon
exit 1
fi

if [[ -z "${HADOOP_DAEMON_JSVC_EXTRA_OPTS}" ]]; then
# If HADOOP_DAEMON_JSVC_EXTRA_OPTS is not set
if ${jsvc} -help | grep -q "\-cwd"; then
# Check if jsvc -help has entry for option -cwd
hadoop_debug "Your jsvc supports -cwd option." \
"Adding option '-cwd .'. See HADOOP-16276 for details."
HADOOP_DAEMON_JSVC_EXTRA_OPTS="-cwd ."
else
hadoop_debug "Your jsvc doesn't support -cwd option." \
"No need to add option '-cwd .'. See HADOOP-16276 for details."
fi
else
hadoop_debug "HADOOP_DAEMON_JSVC_EXTRA_OPTS is set." \
"Ignoring jsvc -cwd option detection and addition."
fi

# note that shellcheck will throw a
# bogus for-our-use-case 2086 here.
# it doesn't properly support multi-line situations
Expand Down

0 comments on commit 2f4702f

Please sign in to comment.