[beast: 1/2] DEBIAN: beast.postinst: set beast launcher suid bit



commit 54180929d2152b9d55959c7487b8fa52b097a4f4
Author: Tim Janik <timj gnu org>
Date:   Tue Nov 3 23:00:53 2015 +0100

    DEBIAN: beast.postinst: set beast launcher suid bit
    
    * beast.postinst: add setuid bit to the beast launcher, so the audio
      processing can run at nice level -20 with soft realtime scheduling.
    
    Signed-off-by: Tim Janik <timj gnu org>

 debian/beast.postinst |   33 +++++++++++++++++++++++++++++++++
 debian/changelog      |    7 +++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/debian/beast.postinst b/debian/beast.postinst
new file mode 100755
index 0000000..a64317c
--- /dev/null
+++ b/debian/beast.postinst
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+
+
+set_perms() {
+  USER="$1"; GROUP="$2"; MODE="$3"; FILE="$4"
+  # https://www.debian.org/doc/debian-policy/ch-files.html#s10.9.1
+  if ! dpkg-statoverride --list "$FILE" > /dev/null ; then
+    chown "$USER:$GROUP" "$FILE"
+    chmod "$MODE" "$FILE"
+  fi
+}
+
+
+# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-mscriptsinstact
+case "$1" in
+  configure)
+    # https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+    set_perms root root 4755 /usr/bin/beast    # wrapper which does renice -20
+    ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+  *)
+    # unkown action
+    exit 1
+    ;;
+esac
+
+
+# Hook for auto-generated debhelper commands, see dh_installdeb(1)
+#DEBHELPER#
+
+exit 0
diff --git a/debian/changelog b/debian/changelog
index eaa017d..1aabacf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+beast (0.9.3+git5563-0) experimental; urgency=medium
+
+  * beast.postinst: add setuid bit to the beast launcher, so the audio
+    processing can run at nice level -20 with soft realtime scheduling.
+
+ -- Tim Janik <timj gnu org>  Tue, 03 Nov 2015 22:44:51 +0100
+
 beast (0.9.3+git5555-0) experimental; urgency=low
 
   * Debian package build setup for Beast and libbse, hosted at:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]