Repository: ambari Updated Branches: refs/heads/trunk 2f038b270 -> 70303d0c6
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/70303d0c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/70303d0c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/70303d0c Branch: refs/heads/trunk Commit: 70303d0c6526c92f53f95fa283f88de08b103559 Parents: 2f038b2 Author: Di Li <[email protected]> Authored: Tue Dec 13 11:53:56 2016 -0500 Committer: Di Li <[email protected]> Committed: Tue Dec 13 11:53:56 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/70303d0c/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/70303d0c/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/70303d0c/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 524fea8..5ecd650 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"
