diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index c483e8d..26bf50a 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -34,6 +34,7 @@ function install() rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} fi mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} + chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 57ef761..2cb5b28 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -2,7 +2,9 @@ # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # Description: ascend-docker-runtime 卸载脚本 set -e - +LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} ROOT=$(cd $(dirname $0); pwd)/.. DST='/etc/docker/daemon.json' SRC="${DST}.${PPID}" @@ -14,10 +16,21 @@ fi ${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then - echo 'ERROR: del damon.json failed' + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} exit 1 fi mv ${SRC} ${DST} [ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} +INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) + +if test -d ${INSTALL_ROOT_PATH} +then + rm -rf ${INSTALL_ROOT_PATH} + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" >>${LOG_FILE} +fi +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" >>${LOG_FILE} \ No newline at end of file