Add sunshine as an optional background service
This commit is contained in:
16
overlay/etc/cont-init.d/90-configure_sunshine.sh
Normal file
16
overlay/etc/cont-init.d/90-configure_sunshine.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
echo "**** Configure Sunshine ****"
|
||||
|
||||
if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
|
||||
if [ "${ENABLE_SUNSHINE:-}" = "true" ]; then
|
||||
echo "Enable Sunshine server"
|
||||
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/sunshine.ini
|
||||
chmod +x /usr/bin/start-sunshine.sh
|
||||
else
|
||||
echo "Disable Sunshine server"
|
||||
fi
|
||||
else
|
||||
echo "Sunshine server not available when container is run in 'secondary' mode"
|
||||
fi
|
||||
|
||||
echo "DONE"
|
||||
20
overlay/etc/supervisor.d/sunshine.ini
Normal file
20
overlay/etc/supervisor.d/sunshine.ini
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
[program:sunshine]
|
||||
priority=50
|
||||
autostart=false
|
||||
autorestart=true
|
||||
# Retry a restart a few times.
|
||||
# The start-sunshine.sh script has a section that will wait for the
|
||||
# X server to become available before executing sunshine. However, this will time out after 30 seconds.
|
||||
startretries=10
|
||||
user=%(ENV_USER)s
|
||||
directory=/home/%(ENV_USER)s
|
||||
command=/usr/bin/start-sunshine.sh
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s"
|
||||
stopsignal=INT
|
||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/sunshine.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=7
|
||||
stderr_logfile=/home/%(ENV_USER)s/.cache/log/sunshine.err.log
|
||||
stderr_logfile_maxbytes=10MB
|
||||
stderr_logfile_backups=7
|
||||
Reference in New Issue
Block a user