Skip to content

Commit 9da9227

Browse files
committed
Set HOME directory for created user
s6-setuidgid does not change the environment, so HOME is still set to root's home directory. See just-containers/s6-overlay#207 Fixes #20
1 parent 173d9b8 commit 9da9227

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

run

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [ -n "$user" ]; then
3838
bashio::log.notice "Replacing existing user with uid $PUID: $user"
3939
deluser "$user"
4040
fi
41-
adduser -G "$GROUP" -D -H -u "$PUID" "$USER"
41+
adduser -G "$GROUP" -D -u "$PUID" "$USER"
4242

4343
if [ -n "${EXTRA_GID:-}" ]; then
4444
bashio::log.info "Resolving suppementary GIDs: $EXTRA_GID"
@@ -94,6 +94,9 @@ fi
9494
bashio::log.info "Activating venv"
9595
. "$VENV_PATH/bin/activate"
9696

97+
bashio::log.info "Setting new \$HOME"
98+
export HOME="$( getent passwd "$USER" | cut -d: -f6 )"
99+
97100
# Everything below should be kept in sync with
98101
# core:rootfs/etc/services.d/home-assistant/run
99102
# from upstream:

0 commit comments

Comments
 (0)