From 6de39b6ebaa03b48e9cc9905c45ff9feb704b61a Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Mon, 29 Dec 2014 23:02:21 -0800 Subject: [PATCH] Create the stack users ~./cache early This creates the users ~/.cache directory with proper permissions prior to running devstack/grenade, avoiding potential permission issues if a later pip installation is run with sudo but without -H. Change-Id: I033fd8a28ed593da343315b6fc5a7658ca8c4e31 Related-bug: #1405626 --- functions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.sh b/functions.sh index f28fd364..12faf848 100644 --- a/functions.sh +++ b/functions.sh @@ -443,6 +443,11 @@ function setup_host { sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh + # Create user's ~/.cache directory with proper permissions, ensuring later + # 'sudo pip install's do not create it owned by root. + sudo mkdir -p $BASE/new/.cache + sudo chown -R stack:stack $BASE/new/.cache + # Create a tempest user for tempest to run as, so that we can # revoke sudo permissions from that user when appropriate. # NOTE(sdague): we should try to get the state dump to be a