-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A wrapper for starting a process conditionally on qvm-service
Add a generic wrapper that starts a given process only if specific qvm-service is enabled. This can be used in desktop files for example (in Exec= line). Note that systemd units have this functionality built in (ConditionExists=). QubesOS/qubes-issues#8161 (cherry picked from commit 5cf9c87)
- Loading branch information
Showing
4 changed files
with
18 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
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
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,12 @@ | ||
#!/bin/sh | ||
|
||
# Start an application given as $2 only if qvm-service $1 is enabled | ||
|
||
service="$1" | ||
shift | ||
if ! [ -r "/run/qubes-service/$service" ]; then | ||
echo "Not starting '$1', qvm-service '$service' is not enabled" >&2 | ||
exit 0 | ||
fi | ||
|
||
exec "$@" |
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