Repository: ranger Updated Branches: refs/heads/master 84b28e9a7 -> d7f73fe42
RANGER-1362:The installer of the usersync and unixauthservice can be executed when JAVA_HOME environment variable was set empty. The result is that there are many errors when installing UserSync and unixauthservice. We should handle the exception as well as tagsync. Signed-off-by: Colm O hEigeartaigh <cohei...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/d7f73fe4 Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/d7f73fe4 Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/d7f73fe4 Branch: refs/heads/master Commit: d7f73fe4243856c60f1260e72c2e1aec1f96f07a Parents: 84b28e9 Author: zhangqiang2 <zhangqia...@zte.com.cn> Authored: Thu Feb 9 07:38:59 2017 -0500 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Thu Feb 9 13:01:18 2017 +0000 ---------------------------------------------------------------------- tagsync/scripts/setup.sh | 4 ++++ unixauthservice/scripts/setup.sh | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/d7f73fe4/tagsync/scripts/setup.sh ---------------------------------------------------------------------- diff --git a/tagsync/scripts/setup.sh b/tagsync/scripts/setup.sh index d2a4f1b..b3f49f0 100755 --- a/tagsync/scripts/setup.sh +++ b/tagsync/scripts/setup.sh @@ -19,6 +19,10 @@ if [ "${JAVA_HOME}" == "" ] then echo "JAVA_HOME environment property not defined, aborting installation." exit 1 +elif [ ! -d "${JAVA_HOME}" ] +then + echo "JAVA_HOME environment property was set incorrectly, aborting installation." + exit 1 else export JAVA_HOME PATH="${JAVA_HOME}/bin:${PATH}" http://git-wip-us.apache.org/repos/asf/ranger/blob/d7f73fe4/unixauthservice/scripts/setup.sh ---------------------------------------------------------------------- diff --git a/unixauthservice/scripts/setup.sh b/unixauthservice/scripts/setup.sh index cf785a1..1a8a269 100755 --- a/unixauthservice/scripts/setup.sh +++ b/unixauthservice/scripts/setup.sh @@ -14,9 +14,15 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -if [ "${JAVA_HOME}" != "" ] +if [ "${JAVA_HOME}" == "" ] +then + echo "JAVA_HOME environment property not defined, aborting installation." + exit 1 +elif [ ! -d "${JAVA_HOME}" ] then + echo "JAVA_HOME environment property was set incorrectly, aborting installation." + exit 1 +else export JAVA_HOME PATH="${JAVA_HOME}/bin:${PATH}" export PATH