Skip to content

Commit

Permalink
fix: Correct sunshine workaround for the latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed May 24, 2024
1 parent d904960 commit 57612bf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[Unit]
Description=Workaround sunshine not having the correct caps
ConditionPathIsSymbolicLink=/usr/bin/sunshine
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 $(readlink -f /usr/bin/sunshine) /usr/local/bin/.sunshine"
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/bash -c "/usr/bin/mount --bind /usr/local/bin/.sunshine $(readlink -f /usr/bin/sunshine)"
ExecStartPre=/usr/bin/bash -c "/usr/bin/mount --bind /usr/local/bin/.sunshine /usr/bin/sunshine
# Fix caps
ExecStart=/usr/bin/bash -c "/usr/sbin/setcap cap_sys_admin+p $(readlink -f /usr/bin/sunshine)"
ExecStart=/usr/sbin/setcap 'cap_sys_admin+p' /usr/bin/sunshine
# Clean-up after ourselves
ExecStop=/usr/bin/bash -c "/usr/bin/umount $(readlink -f /usr/bin/sunshine)"
ExecStop=/usr/bin/umount /usr/bin/sunshine
ExecStop=/usr/bin/rm /usr/local/bin/.sunshine
RemainAfterExit=yes
Expand Down

1 comment on commit 57612bf

@vonhyd
Copy link

@vonhyd vonhyd commented on 57612bf Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a quote missing at the end of line 11

Please sign in to comment.