Adjusted install_user script for Ubuntu 24.04 support (#138815)

Fixes #138812

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138815
Approved by: https://github.com/pruthvistony, https://github.com/jithunnair-amd, https://github.com/malfet
This commit is contained in:
iupaikov-amd 2024-10-30 16:31:09 +00:00 committed by PyTorch MergeBot
parent 29eb65fce8
commit 996c40e85e

View File

@ -2,6 +2,13 @@
set -ex
# Since version 24 the system ships with user 'ubuntu' that has id 1000
# We need a work-around to enable id 1000 usage for this script
if [[ $UBUNTU_VERSION == 24.04 ]]; then
# touch is used to disable harmless error message
touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu
fi
# Mirror jenkins user in container
# jenkins user as ec2-user should have the same user-id
echo "jenkins:x:1000:1000::/var/lib/jenkins:" >> /etc/passwd