Skip to content

Commit

Permalink
Handle errors when users already exist
Browse files Browse the repository at this point in the history
The passwd file is on ephemeral storage, so it survives
container restarts but not recreate.

Change-type: patch
Signed-off-by: Kyle Harding <kyle@balena.io>
  • Loading branch information
klutchell committed Nov 22, 2023
1 parent 0a4efbd commit e71ae3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yocto-build-env/s6-overlay/scripts/addusers
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for user_id in ${user_ids}; do
echo "Creating user ${name}..."

# create a new user and home directory
useradd "${name}" --comment "${name}" --create-home --groups sudo,docker --uid "${uid}"
useradd "${name}" --comment "${name}" --create-home --groups sudo,docker --uid "${uid}" || true
id "${name}"

# fetch the user's ssh keys from github
Expand Down

0 comments on commit e71ae3f

Please sign in to comment.