-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·25 lines (21 loc) · 1.04 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·25 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# FakeNotify daemon container entrypoint.
#
# Publishes the LD_PRELOAD library and the daemon socket into the
# shared volume mounted at $FAKENOTIFY_SHARE (default /fakenotify), so
# sibling consumer containers only need to mount the same volume +
# set LD_PRELOAD + FAKENOTIFY_SOCKET to the volume paths.
set -eu
SHARE="${FAKENOTIFY_SHARE:-/fakenotify}"
mkdir -p "$SHARE/lib" "$SHARE/run"
# Refresh the .so each boot so consumers always run the version baked
# into the daemon image. Cheap on a tmpfs/volume; safer than stale.
cp /usr/local/lib/libfakenotify_preload.so "$SHARE/lib/libfakenotify_preload.so"
chmod 0755 "$SHARE/lib/libfakenotify_preload.so"
# Default the daemon socket into the shared volume. The daemon CLI
# reads FAKENOTIFY_SOCKET directly (crates/daemon/src/cli.rs:30,45,52,
# 70,80,87 — every subcommand's `--socket` arg has env = "FAKENOTIFY_
# SOCKET"), so just exporting it is enough; no flag wiring needed.
: "${FAKENOTIFY_SOCKET:=$SHARE/run/fakenotify.sock}"
export FAKENOTIFY_SOCKET
exec /usr/local/bin/fakenotifyd "$@"