AMBARI-18563. Ambari startup script doesn't work on SUSE and potentially other OS's. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c4e52298 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c4e52298 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c4e52298 Branch: refs/heads/branch-2.4 Commit: c4e522983325f34b6fc11e95c764c340012289d2 Parents: 0e01a35 Author: Andrew Onishuk <[email protected]> Authored: Mon Oct 10 17:52:39 2016 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Mon Oct 10 17:52:39 2016 +0300 ---------------------------------------------------------------------- ambari-server/conf/unix/install-helper.sh | 1 + ambari-server/sbin/ambari-server | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c4e52298/ambari-server/conf/unix/install-helper.sh ---------------------------------------------------------------------- diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh index 369a56a..3163713 100644 --- a/ambari-server/conf/unix/install-helper.sh +++ b/ambari-server/conf/unix/install-helper.sh @@ -102,6 +102,7 @@ do_install(){ sed -i "s|ambari.root.dir\s*=\s*/|ambari.root.dir=${ROOT}|g" "$AMBARI_LOG4J" sed -i "s|root_dir\s*=\s*/|root_dir = ${ROOT}|g" "$CA_CONFIG" + sed -i "s|^ROOT=\"/\"$|ROOT=\"${ROOT}\"|g" "$AMBARI_SERVER_EXECUTABLE" AUTOSTART_SERVER_CMD="" which chkconfig > /dev/null 2>&1 http://git-wip-us.apache.org/repos/asf/ambari/blob/c4e52298/ambari-server/sbin/ambari-server ---------------------------------------------------------------------- diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server index 88eb3db..da86c7a 100755 --- a/ambari-server/sbin/ambari-server +++ b/ambari-server/sbin/ambari-server @@ -44,8 +44,10 @@ case "${1:-}" in esac SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -export ROOT=`dirname $(dirname $SCRIPT_DIR)` +# the below line (ROOT="/") is replaced by install-helper.sh. Don't edit/remove it. +ROOT="/" ROOT=`echo $ROOT | sed 's/\/$//'` +export ROOT export PATH=$ROOT/usr/lib/ambari-server/*:$PATH:/sbin/:/usr/sbin export AMBARI_CONF_DIR=$ROOT/etc/ambari-server/conf
