-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add workaround for Sunshine to set correct caps for KMS
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
system_files/desktop/shared/usr/lib/systemd/system/sunshine-workaround.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Workaround sunshine not having the correct caps | ||
ConditionFileIsExecutable=/usr/bin/sunshine | ||
After=local-fs.target | ||
|
||
[Service] | ||
Type=oneshot | ||
# Copy if it doesn't exist | ||
ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/bin/.sunshine ] || /usr/bin/cp /usr/bin/sunshine /usr/local/bin/.sunshine" | ||
# This is faster than using .mount unit. Also allows for the previous line/cleanup | ||
ExecStartPre=/usr/bin/mount --bind /usr/local/bin/.sunshine /usr/bin/sunshine | ||
# Fix caps | ||
ExecStart=/usr/sbin/setcap cap_sys_admin+p /usr/bin/sunshine | ||
# Clean-up after ourselves | ||
ExecStop=/usr/bin/umount /usr/bin/sunshine | ||
ExecStop=/usr/bin/rm /usr/local/bin/.sunshine | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
1 change: 1 addition & 0 deletions
1
system_files/desktop/shared/usr/lib/tmpfiles.d/sunshine-workaround.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C /usr/local/bin/.sunshine - - - - /usr/bin/sunshine |