Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with tools/bazel_in_docker.sh if username == groupname #1137

Closed
vfdev-5 opened this issue Oct 11, 2018 · 1 comment
Closed

Error with tools/bazel_in_docker.sh if username == groupname #1137

vfdev-5 opened this issue Oct 11, 2018 · 1 comment

Comments

@vfdev-5
Copy link
Contributor

vfdev-5 commented Oct 11, 2018

Following code:

local cmdline="groupadd -f ${groupname} && groupmod -o -g ${gid} ${groupname}"
cmdline+="; id -u ${username} &>/dev/null || useradd ${username} && usermod -o -u ${uid} -g ${gid} ${username}"

will produce the error:

useradd: group user exists - if you want to add this user to that group, use -g.
chroot: invalid user

if username and groupname are the same.

EDIT: A simple solution can be to add -N:

 cmdline+="; id -u ${username} &>/dev/null || useradd -N ${username} && usermod -o -u ${uid} -g ${gid} ${username}" 
@netfs
Copy link
Collaborator

netfs commented Oct 12, 2018

Thanks for the report. Can you please send a PR to fix this issue? Thanks again!

vfdev-5 added a commit to vfdev-5/serving that referenced this issue Oct 12, 2018
netfs pushed a commit to netfs/serving that referenced this issue Oct 23, 2018
Fixes tensorflow#1137

(cherry picked from commit 97978ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants