Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 4a6fa1f

Browse files
committed
Add check for IPC_LOCK capability in init script
1 parent 9b79fb2 commit 4a6fa1f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docker/init.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ set -e
55
script="$0"
66
DIR="$(dirname $script)"
77

8+
capabilities=$(capsh --print | grep -e "Current: .*ipc_lock" | sed s/\n// | sed s/\ //)
9+
ipc_error="IPC_LOCK capability is not enabled. If you are running a docker container, add the capability using the '--cap-add' option."
10+
11+
if [ -z "$capabilities" ]; then
12+
echo "$ipc_error"
13+
exit 2
14+
fi
15+
816
if ! pgrep -x "dbus-daemon" > /dev/null
917
then
1018
export DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --session --fork --print-address)

0 commit comments

Comments
 (0)