mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-26 16:07:34 -05:00
Add kill-vboxdrmclient-on-shutdown.service
This commit is contained in:
parent
9d86379f56
commit
5fbd42bbec
3 changed files with 46 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
||||
## See the file COPYING for copying conditions.
|
||||
|
||||
[Unit]
|
||||
Description=kill VBoxDRMClient during shutdown to allow /tmp to be unmounted properly
|
||||
ConditionVirtualization=oracle
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=true
|
||||
ExecStop=/usr/libexec/security-misc/kill-vboxdrmclient-on-shutdown
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
||||
## See file COPYING for copying conditions.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o errtrace
|
||||
set -o pipefail
|
||||
|
||||
vboxdrmclient_sock='/tmp/.iprt-localipc-DRMIpcServer'
|
||||
|
||||
if ! [ -S "$vboxdrmclient_sock" ]; then
|
||||
printf '%s\n' "'$vboxdrmclient_sock' does not exist or is not a socket, ok."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sock_pid="$(/usr/libexec/helper-scripts/query-sock-pid "$vboxdrmclient_sock")" || true
|
||||
if [ -z "$sock_pid" ]; then
|
||||
printf '%s\n' "Cannot get PID listening on '$vboxdrmclient_sock', ok."
|
||||
exit 0
|
||||
fi
|
||||
if kill -SIGKILL "$sock_pid"; then
|
||||
printf '%s\n' "Killed VBoxDRMClient ('$sock_pid'), ok."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "ERROR: Could not kill VBoxDRMClient ('$sock_pid')!"
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue