Skip to content

Commit 4115d13

Browse files
committed
Merge upstream changes regarding jemalloc
Cf. home-assistant/core@f94bbda
1 parent 46245ca commit 4115d13

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

run

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ PACKAGES="${PACKAGES:-}"
1111
VENV_PATH="${VENV:-/var/tmp/homeassistant-venv}"
1212
CONFIG_PATH=/config
1313

14-
# Enable Jemalloc for Home Assistant Core
15-
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
16-
1714
#
18-
# Creating user
15+
# Create user
1916
#
2017

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

73-
cd "$CONFIG_PATH" || bashio::exit.nok "Can't find config folder: $CONFIG_PATH"
74-
7570
if [ -n "${UMASK}" ]; then
7671
bashio::log.info "Setting umask: $UMASK"
7772
umask "$UMASK"
@@ -84,6 +79,16 @@ fi
8479
bashio::log.info "Activating venv"
8580
. "$VENV_PATH/bin/activate"
8681

82+
# Everything below should be kept in sync with
83+
# core:rootfs/etc/services.d/home-assistant/run
84+
# from upstream:
85+
cd "$CONFIG_PATH" || bashio::exit.nok "Can't find config folder: $CONFIG_PATH"
86+
87+
# Enable Jemalloc for Home Assistant Core, unless disabled
88+
if [[ -z "${DISABLE_JEMALLOC+x}" ]]; then
89+
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
90+
fi
91+
8792
bashio::log.info "Starting homeassistant"
8893
exec \
8994
s6-setuidgid "$USER" \

0 commit comments

Comments
 (0)