The membarrier check is no longer done by the logmonitor.

This commit is contained in:
Jocelyn Le Sage 2023-01-04 20:38:16 -05:00
parent 071fb903b0
commit e4c8628bf9
7 changed files with 22 additions and 33 deletions

View File

@ -101,11 +101,6 @@ RUN \
# del-pkg build-dependencies && \
# rm -rf /tmp/* /tmp/.[!.]*
# Enable log monitoring.
RUN \
sed-patch 's|LOG_FILES=|LOG_FILES=/config/log/firefox/error.log|' /etc/logmonitor/logmonitor.conf && \
sed-patch 's|STATUS_FILES=|STATUS_FILES=/tmp/.firefox_shm_check,/tmp/.firefox_membarrier_check|' /etc/logmonitor/logmonitor.conf
# Generate and install favicons.
RUN \
APP_ICON_URL=https://github.com/jlesage/docker-templates/raw/master/jlesage/images/firefox-icon.png && \

View File

@ -17,13 +17,6 @@ fi
# Copy default preferences.
[ -f /config/profile/prefs.js ] || cp /defaults/prefs.js /config/profile/prefs.js
if /usr/bin/membarrier_check 2>/dev/null; then
echo 'MEMBARRIER_CHECK_PASS' > /tmp/.firefox_membarrier_check
else
echo 'MEMBARRIER_CHECK_FAIL' > /tmp/.firefox_membarrier_check
fi
chown $USER_ID:$GROUP_ID /tmp/.firefox_membarrier_check
# Clean/optimize Firefox databases.
#if [ -d /config/.mozilla/firefox ] && [ -d /config/profile ]; then
# [ -f /config/.mozilla/firefox/profiles.ini ] || cp /defaults/profiles.ini /config/.mozilla/firefox/

View File

@ -1,2 +0,0 @@
#!/bin/sh
echo "$APP_NAME is likely to crash because it requires the membarrier system call. See the documentation of this Docker container to find out how this system call can be allowed."

View File

@ -1,16 +0,0 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status.
set -u # Treat unset variables as an error.
LINE="$1"
if [ "$LINE" = "MEMBARRIER_CHECK_FAIL" ]; then
echo 'MEMBARRIER_CHECK_ACK' > /tmp/.firefox_membarrier_check
exit 0
fi
# No match found.
exit 1
# vim: set ft=sh :

View File

@ -1 +0,0 @@
WARNING

View File

@ -1,2 +0,0 @@
#!/bin/sh
echo "$APP_NAME requires the membarrier system call."

View File

@ -5,5 +5,27 @@ set -u # Treat unset variables as an error.
export HOME=/config
PIDS=
notify() {
for N in $(ls /etc/logmonitor/targets.d/*/send)
do
"$N" "$1" "$2" "$3" &
PIDS="$PIDS $!"
done
}
# Verify support for membarrier.
if ! /usr/bin/membarrier_check 2>/dev/null; then
notify "$APP_NAME requires the membarrier system call." "$APP_NAME is likely to crash because it requires the membarrier system call. See the documentation of this Docker container to find out how this system call can be allowed." "WARNING"
fi
# Wait for all PIDs to terminate.
set +e
for PID in "$PIDS"; do
wait $PID
done
set -e
/usr/bin/firefox --version
exec /usr/bin/firefox "$@" >> /config/log/firefox/output.log 2>> /config/log/firefox/error.log