Skip to content

Commit 1a0c0e4

Browse files
smengcljojochuang
authored andcommitted
HADOOP-16276. Fix jsvc startup command in hadoop-functions.sh due to jsvc >= 1.0.11 changed default current working directory (#1272)
1 parent 6f899e9 commit 1a0c0e4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,22 @@ function hadoop_start_secure_daemon
19211921
exit 1
19221922
fi
19231923

1924+
if [[ -z "${HADOOP_DAEMON_JSVC_EXTRA_OPTS}" ]]; then
1925+
# If HADOOP_DAEMON_JSVC_EXTRA_OPTS is not set
1926+
if ${jsvc} -help | grep -q "\-cwd"; then
1927+
# Check if jsvc -help has entry for option -cwd
1928+
hadoop_debug "Your jsvc supports -cwd option." \
1929+
"Adding option '-cwd .'. See HADOOP-16276 for details."
1930+
HADOOP_DAEMON_JSVC_EXTRA_OPTS="-cwd ."
1931+
else
1932+
hadoop_debug "Your jsvc doesn't support -cwd option." \
1933+
"No need to add option '-cwd .'. See HADOOP-16276 for details."
1934+
fi
1935+
else
1936+
hadoop_debug "HADOOP_DAEMON_JSVC_EXTRA_OPTS is set." \
1937+
"Ignoring jsvc -cwd option detection and addition."
1938+
fi
1939+
19241940
# note that shellcheck will throw a
19251941
# bogus for-our-use-case 2086 here.
19261942
# it doesn't properly support multi-line situations

0 commit comments

Comments
 (0)