diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-06-13 23:30:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 23:30:57 +0300 |
commit | fa07406f4dccd482284cb9d8dbaca6533116dab8 (patch) | |
tree | 438c8fd7b17b3d69ecede41ea0bdea99fe0e4eea /src/python | |
parent | 19fd66af965b22f57fd59a0ba31136146b9542d1 (diff) |
add missing user groups to fix permission issues for non root user (#45)
* add missing user groups
* fix username
* move chmod: anaconda
Diffstat (limited to 'src/python')
-rwxr-xr-x | src/python/install.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/python/install.sh b/src/python/install.sh index c976671..5bc3a18 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -341,6 +341,11 @@ check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev li # Install Python from source if needed if [ "${PYTHON_VERSION}" != "none" ]; then + if ! cat /etc/group | grep -e "^python:" > /dev/null 2>&1; then + groupadd -r python + fi + usermod -a -G python "${USERNAME}" + CURRENT_PATH="${PYTHON_INSTALL_PATH}/current" # If the os-provided versions are "good enough", detect that and bail out. if [ ${PYTHON_VERSION} = "os-provided" ] || [ ${PYTHON_VERSION} = "system" ]; then @@ -357,6 +362,10 @@ if [ "${PYTHON_VERSION}" != "none" ]; then fi updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi" + + chown -R :python "${PYTHON_INSTALL_PATH}" + chmod -R g+r+w "${PYTHON_INSTALL_PATH}" + find "${PYTHON_INSTALL_PATH}" -type d | xargs -n 1 chmod g+s fi # Install Python tools if needed @@ -403,6 +412,10 @@ if [ "${INSTALL_PYTHON_TOOLS}" = "true" ]; then updaterc "export PIPX_HOME=\"${PIPX_HOME}\"" updaterc "export PIPX_BIN_DIR=\"${PIPX_BIN_DIR}\"" updaterc "if [[ \"\${PATH}\" != *\"\${PIPX_BIN_DIR}\"* ]]; then export PATH=\"\${PATH}:\${PIPX_BIN_DIR}\"; fi" + + chown -R :python "${PIPX_HOME}" + chmod -R g+r+w "${PIPX_HOME}" + find "${PIPX_HOME}" -type d | xargs -n 1 chmod g+s fi # Install JupyterLab if needed |