diff options
author | Venkata Harish K Kajur <vk250x@att.com> | 2017-06-08 04:03:44 -0400 |
---|---|---|
committer | Venkata Harish K Kajur <vk250x@att.com> | 2017-06-08 04:04:35 -0400 |
commit | 0bb4902eabf1c025395d05a312947ce0445e37c6 (patch) | |
tree | ed4056b6a90fd04db8fcfb9cbcd530c7253f6f70 | |
parent | 9d9078bdb77f868a495d7db0aa19bf170083d001 (diff) |
Change the deploy vm1 logs directory permission
Change-Id: Ia2d6b5467a13397161ee6612fbbbf66733fcf811
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
-rwxr-xr-x | deploy_vm1.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/deploy_vm1.sh b/deploy_vm1.sh index bf06952..f4e65a6 100755 --- a/deploy_vm1.sh +++ b/deploy_vm1.sh @@ -108,8 +108,33 @@ $DOCKER_COMPOSE_CMD rm -f -v USER_ID=$(docker run -it --rm --entrypoint=id $DOCKER_REGISTRY/openecomp/aai-resources -u | sed 's/[^0-9]//g') GROUP_ID=$(docker run -it --rm --entrypoint=id $DOCKER_REGISTRY/openecomp/aai-resources -g | sed 's/[^0-9]//g') -chown -R $USER_ID:$GROUP_ID $RESOURCES_LOGS; -chown -R $USER_ID:$GROUP_ID $TRAVERSAL_LOGS; +chown -R $USER_ID:$GROUP_ID $RESOURCES_LOGS || { + + echo "Unable to change ownership of $RESOURCE_LOGS to $USER_ID:$GROUP_ID" >> /var/tmp/deploy_vm1.log; + echo "Trying with sudo now" >> /var/tmp/deploy_vm1.log; + + chown -R 999:999 $RESOURCES_LOGS; + + if [ $? -ne 0 ]; then + echo "Unable to change ownership of $RESOURCE_LOGS to 999:999 as well" >> /var/tmp/deploy_vm1.log; + sudo chown -R 999:999 $RESOURCE_LOGS; + fi; + +}; + +chown -R $USER_ID:$GROUP_ID $TRAVERSAL_LOGS || { + + echo "Unable to change ownership of $TRAVERSAL_LOGS to $USER_ID:$GROUP_ID" >> /var/tmp/deploy_vm1.log; + echo "Trying with sudo now" >> /var/tmp/deploy_vm1.log; + + chown -R 999:999 $RESOURCES_LOGS; + + if [ $? -ne 0 ]; then + echo "Unable to change ownership of $TRAVERSAL_LOGS to 999:999 as well" >> /var/tmp/deploy_vm1.log; + sudo chown -R 999:999 $TRAVERSAL_LOGS; + fi; + +}; RESOURCES_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1); wait_for_container $RESOURCES_CONTAINER_NAME '0.0.0.0:8447'; |