Files
docker-steam-headless/overlay/usr/bin/start-udev.sh
Josh.5 97613b227f Run Sunshine as a service
Goodbye Flatpak Sunshine. Hello AppImage.
Until a deb package is available for Debian Bookworm, we can just run sunshine as an AppImage.
It is faster to startup and is a little less bloated.

The goal here is to run Sunshine as a service managed by supervisord so that it is kept running and is restarted automatically if stopped.
2023-08-29 18:02:03 +12:00

44 lines
864 B
Bash
Executable File

#!/usr/bin/env bash
###
# File: start-udev.sh
# Project: bin
# File Created: Tuesday, 12th January 2022 8:46:47 am
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Friday, 14th January 2022 9:21:00 am
# Modified By: Josh.5 (jsunnex@gmail.com)
###
set -e
# CATCH TERM SIGNAL:
_term() {
kill -TERM "$monitor_pid" 2>/dev/null
}
trap _term SIGTERM SIGINT
# CONFIGURE:
# Remove lockfile
rm -f /tmp/.started-udev
# EXECUTE PROCESS:
# Start udev
if command -v udevd &>/dev/null; then
unshare --net udevd --daemon &>/dev/null
else
unshare --net /lib/systemd/systemd-udevd --daemon &>/dev/null
fi
# Monitor kernel uevents
udevadm monitor &
monitor_pid=$!
# Touch lockfile
sleep 1
touch /tmp/.started-udev
# Wait for 10 seconds, then request device events from the kernel
sleep 10
udevadm trigger
# WAIT FOR CHILD PROCESS:
wait "$monitor_pid"