Browse Source

AMBARI-18563. Ambari startup script doesn't work on SUSE and potentially other OS's. (aonishuk)

Andrew Onishuk 9 years ago
parent
commit
a0693e0010
2 changed files with 4 additions and 1 deletions
  1. 1 0
      ambari-server/conf/unix/install-helper.sh
  2. 3 1
      ambari-server/sbin/ambari-server

+ 1 - 0
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

+ 3 - 1
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