Files
netris-nestri/packages/configs/s6-overlay/dbus-session/run
2026-02-19 18:02:10 +02:00

26 lines
519 B
Plaintext

#!/command/with-contenv bash
set -euo pipefail
if [[ -f /etc/nestri/common.sh ]]; then
source /etc/nestri/common.sh
else
exit 1
fi
# remove possibly stale socket
rm -f "${NESTRI_XDG_RUNTIME_DIR}/bus"
s6-setuidgid ${NESTRI_USER} dbus-daemon --session --address=unix:path="${NESTRI_XDG_RUNTIME_DIR}/bus" --nofork --nopidfile &
PROCESS_PID=$!
# wait for socket
while ! test -S "${NESTRI_XDG_RUNTIME_DIR}/bus"; do
sleep 0.5
done
# notify
printf 'ready\n' >&3
# wait till process exits
wait "${PROCESS_PID}"