[SCM] team based FPS game - packaging branch, debian, updated. debian/1.1.0-4.1-33-g855d6ce

Simon McVittie smcv at debian.org
Sat Jul 17 14:10:58 UTC 2010


The following commit has been merged in the debian branch:
commit ea43459b10d786d732b84d8575a878682f9fafc3
Author: Simon McVittie <smcv at debian.org>
Date:   Sat Jul 17 12:16:49 2010 +0100

    Improve the tremulous-server init script (Closes: #469576)
    
    - run tremded under a dedicated user ID, not as nobody (which shouldn't be
      used like this)
    - give that dedicated user ID a home directory, since Tremulous needs one

diff --git a/debian/changelog b/debian/changelog
index 8409dc6..8501b79 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,10 +18,13 @@ tremulous (1.1.0-5) UNRELEASED; urgency=low
     modified menu to override the one in tremulous-data (Closes: #476621)
   * Disable JIT QVM compiler (which seems to crash on startup) on x86-64,
     falling back to the architecture-neutral QVM interpreter
-  * Improve the tremulous-server init script so it stops the process correctly
-    (partially addresses #469576)
-  * Disable the tremulous-server init script by default - enable it in
-    /etc/default/tremulous-server if you want a system-wide instance
+  * Improve the tremulous-server init script (Closes: #469576):
+    - stop the process correctly
+    - disable the tremulous-server init script by default - enable it in
+      /etc/default/tremulous-server if you want a system-wide instance
+    - run tremded under a dedicated user ID, not as nobody (which shouldn't be
+      used like this)
+    - give that dedicated user ID a home directory, since Tremulous needs one
 
  -- Simon McVittie <smcv at debian.org>  Mon, 12 Jul 2010 22:22:25 +0100
 
diff --git a/debian/control b/debian/control
index 330fca1..afbf299 100644
--- a/debian/control
+++ b/debian/control
@@ -39,7 +39,7 @@ Description: Aliens vs Humans, team based FPS game with elements of an RTS
 Package: tremulous-server
 Architecture: any
 Section: contrib/games
-Depends: ${shlibs:Depends}, tremulous-data (>= 1.1.0-1)
+Depends: ${shlibs:Depends}, tremulous-data (>= 1.1.0-1), adduser
 Suggests: tremulous-doc, tremulous
 Description: Tremulous server
  The package provides the dedicated server for Tremulous.
diff --git a/debian/tremulous-server.init b/debian/tremulous-server.init
index d9ebf21..15759f4 100644
--- a/debian/tremulous-server.init
+++ b/debian/tremulous-server.init
@@ -36,7 +36,7 @@ tremulous_start() {
     fi
     start-stop-daemon --start --quiet --pidfile $PIDFILE --oknodo \
 	--background --exec $BINARY --startas $DAEMON \
-	--make-pidfile --chuid nobody \
+	--make-pidfile --chuid tremulous-server \
 	-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
     return 0
 }
diff --git a/debian/tremulous-server.postinst b/debian/tremulous-server.postinst
new file mode 100644
index 0000000..a15863f
--- /dev/null
+++ b/debian/tremulous-server.postinst
@@ -0,0 +1,35 @@
+#!/bin/sh
+# postinst script for tremulous
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+  configure)
+    if ! getent passwd tremulous-server >/dev/null; then
+      adduser --disabled-password  --quiet --system \
+        --home /var/games/tremulous-server --no-create-home \
+        --gecos "Tremulous dedicated server" --ingroup games tremulous-server
+    fi
+    install -d /var/games
+    install -d -o tremulous-server -g games /var/games/tremulous-server
+  ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+  ;;
+  *)
+    echo "postinst called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/tremulous-server.postrm b/debian/tremulous-server.postrm
new file mode 100644
index 0000000..e114fa3
--- /dev/null
+++ b/debian/tremulous-server.postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ] ; then
+    deluser --quiet --system tremulous-server > /dev/null || true
+fi

-- 
team based FPS game - packaging



More information about the Pkg-games-commits mailing list