Repository: ambari Updated Branches: refs/heads/branch-2.5 56271c8aa -> bb9200430
AMBARI-19140 Ambari Server symbolic links has double // when root dir is just / (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bb920043 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bb920043 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bb920043 Branch: refs/heads/branch-2.5 Commit: bb920043077e67a7840fd264d2df306c6213f1e4 Parents: 56271c8 Author: Di Li <[email protected]> Authored: Tue Dec 13 11:53:56 2016 -0500 Committer: Di Li <[email protected]> Committed: Tue Dec 13 12:03:28 2016 -0500 ---------------------------------------------------------------------- ambari-server/conf/unix/install-helper.sh | 9 +++++---- ambari-server/src/main/package/rpm/posttrans_server.sh | 3 +-- ambari-server/src/main/package/rpm/preinstall.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/bb920043/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 34ec0e9..8def27a 100644 --- a/ambari-server/conf/unix/install-helper.sh +++ b/ambari-server/conf/unix/install-helper.sh @@ -16,7 +16,8 @@ #########################################postinstall.sh######################### # SERVER INSTALL HELPER # ################################################################## -ROOT="${RPM_INSTALL_PREFIX}" # Customized folder, which ambari-server files are installed into ('/' or '' are default). +ROOT_DIR_PATH="${RPM_INSTALL_PREFIX}" +ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'` # Customized folder, which ambari-server files are installed into ('/' or '' are default). COMMON_DIR="${ROOT}/usr/lib/python2.6/site-packages/ambari_commons" RESOURCE_MANAGEMENT_DIR="${ROOT}/usr/lib/python2.6/site-packages/resource_management" @@ -100,9 +101,9 @@ do_install(){ ln -s "$AMBARI_PYTHON" "$PYTHON_WRAPER_TARGET" fi - 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" + sed -i "s|ambari.root.dir\s*=\s*/|ambari.root.dir=${ROOT_DIR_PATH}|g" "$AMBARI_LOG4J" + sed -i "s|root_dir\s*=\s*/|root_dir = ${ROOT_DIR_PATH}|g" "$CA_CONFIG" + sed -i "s|^ROOT=\"/\"$|ROOT=\"${ROOT_DIR_PATH}\"|g" "$AMBARI_SERVER_EXECUTABLE" AUTOSTART_SERVER_CMD="" which chkconfig > /dev/null 2>&1 http://git-wip-us.apache.org/repos/asf/ambari/blob/bb920043/ambari-server/src/main/package/rpm/posttrans_server.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/package/rpm/posttrans_server.sh b/ambari-server/src/main/package/rpm/posttrans_server.sh index a719cae..1384eea 100644 --- a/ambari-server/src/main/package/rpm/posttrans_server.sh +++ b/ambari-server/src/main/package/rpm/posttrans_server.sh @@ -13,8 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License - -ROOT="${RPM_INSTALL_PREFIX}" +ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'` RESOURCE_MANAGEMENT_DIR="${ROOT}/usr/lib/python2.6/site-packages/resource_management" RESOURCE_MANAGEMENT_DIR_SERVER="${ROOT}/usr/lib/ambari-server/lib/resource_management" http://git-wip-us.apache.org/repos/asf/ambari/blob/bb920043/ambari-server/src/main/package/rpm/preinstall.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/package/rpm/preinstall.sh b/ambari-server/src/main/package/rpm/preinstall.sh index b4c4da0..7977ab8 100644 --- a/ambari-server/src/main/package/rpm/preinstall.sh +++ b/ambari-server/src/main/package/rpm/preinstall.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License -ROOT="${RPM_INSTALL_PREFIX}" +ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'` STACKS_FOLDER="${ROOT}/var/lib/ambari-server/resources/stacks" STACKS_FOLDER_OLD="${ROOT}/var/lib/ambari-server/resources/stacks_$(date '+%d_%m_%y_%H_%M').old"
