Skip to content

Commit

Permalink
Merge upstream changes regarding jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
tribut committed Jun 5, 2020
1 parent 46245ca commit 4115d13
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ PACKAGES="${PACKAGES:-}"
VENV_PATH="${VENV:-/var/tmp/homeassistant-venv}"
CONFIG_PATH=/config

# Enable Jemalloc for Home Assistant Core
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"

#
# Creating user
# Create user
#

# Some HA commands seem to fail if we don't have an actual user.
Expand Down Expand Up @@ -70,8 +67,6 @@ su "$USER" \
# Fix permissions
#

cd "$CONFIG_PATH" || bashio::exit.nok "Can't find config folder: $CONFIG_PATH"

if [ -n "${UMASK}" ]; then
bashio::log.info "Setting umask: $UMASK"
umask "$UMASK"
Expand All @@ -84,6 +79,16 @@ fi
bashio::log.info "Activating venv"
. "$VENV_PATH/bin/activate"

# Everything below should be kept in sync with
# core:rootfs/etc/services.d/home-assistant/run
# from upstream:
cd "$CONFIG_PATH" || bashio::exit.nok "Can't find config folder: $CONFIG_PATH"

# Enable Jemalloc for Home Assistant Core, unless disabled
if [[ -z "${DISABLE_JEMALLOC+x}" ]]; then
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
fi

bashio::log.info "Starting homeassistant"
exec \
s6-setuidgid "$USER" \
Expand Down

0 comments on commit 4115d13

Please sign in to comment.