summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenton Liu2020-12-29 01:55:37 -0800
committerDenton Liu2020-12-29 01:55:37 -0800
commit417ffe73e66068c05aee22489c2b1a90f0ab079f (patch)
treeb6d4a21c68993aea8397d8769c333733a8230811
parentdebebf8330c813a300e4b0fe65f579dc099480d3 (diff)
parent0c5ea71c389de4eca6d7c772ee67aaae35191d9e (diff)
downloadaur-417ffe73e66068c05aee22489c2b1a90f0ab079f.tar.gz
Merge branch 'master' into master-bin
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xcrewlink35
3 files changed, 37 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 91b469ac0360..40f1ee322ce0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = crewlink-bin
pkgdesc = Free, open, Among Us Proximity Chat
pkgver = 1.1.6
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/zbanks/CrewLink
arch = x86_64
license = GPL3
@@ -10,7 +10,7 @@ pkgbase = crewlink-bin
source = https://github.com/zbanks/CrewLink/releases/download/v1.1.6-linux/CrewLink-1.1.6.AppImage
source = crewlink
sha256sums = 3c057ab6f8864a1915a05180d1af53c88ee7550b576d2e3a8efdf7d8280fa446
- sha256sums = 80a5eb8b16ef5b92e164bc281cfd1bf5b7f9ff3996dd3122dae67f5356c97531
+ sha256sums = d94f1847d9e7909de929dc7579cd2ab934872f20faee9822b4abc85c0b0afcc1
pkgname = crewlink-bin
diff --git a/PKGBUILD b/PKGBUILD
index a1519234a747..6f45e7e07a26 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Denton Liu <liu.denton@gmail.com>
pkgname=crewlink-bin
pkgver=1.1.6
-pkgrel=1
+pkgrel=2
pkgdesc='Free, open, Among Us Proximity Chat'
arch=('x86_64')
url='https://github.com/zbanks/CrewLink'
@@ -11,7 +11,7 @@ conflicts=('crewlink')
source=("https://github.com/zbanks/CrewLink/releases/download/v$pkgver-linux/CrewLink-$pkgver.AppImage"
crewlink)
sha256sums=('3c057ab6f8864a1915a05180d1af53c88ee7550b576d2e3a8efdf7d8280fa446'
- '80a5eb8b16ef5b92e164bc281cfd1bf5b7f9ff3996dd3122dae67f5356c97531')
+ 'd94f1847d9e7909de929dc7579cd2ab934872f20faee9822b4abc85c0b0afcc1')
package() {
cd "$srcdir"
diff --git a/crewlink b/crewlink
index 2afc6ff09b61..d91a191d3a27 100755
--- a/crewlink
+++ b/crewlink
@@ -5,9 +5,40 @@ error () {
exit 1
}
+process_tree () {
+ children=$(cat /proc/"$1"/task/*/children)
+ echo "$1"
+ for p in $children
+ do
+ process_tree "$p"
+ done
+}
+
key='kernel.yama.ptrace_scope'
old_value=$(sysctl -n "$key")
sysctl "$key=0" || error "unable to run 'sysctl $key=0' (did you run this as root?)"
-su "$(logname)" -c '/opt/CrewLink/crewlink'
-sysctl "$key=$old_value" || error "unable to run 'sysctl $key=$old_value'"
+trap 'sysctl "$key=$old_value"' EXIT
+trap 'exit' INT
+
+su "$(logname)" -c /opt/CrewLink/crewlink &
+
+cl_pid="$!"
+max_procs=0
+
+# This is a dirty, dirty hack. This is required because closing the window
+# doesn't result in the process tree dying. Some zygote processes are left
+# behind. Instead of letting crewlink clean up after itself, detect when some
+# processes have died and just kill off the rest.
+while true
+do
+ sleep 1
+ cur_procs=$(process_tree "$cl_pid" | wc -l)
+ if test "$(( max_procs - 1 > cur_procs ))" = 1
+ then
+ break
+ fi
+ max_procs="$cur_procs"
+done
+kill "$cl_pid"
+wait