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

X Strike Force SVN commit: rev 353 - trunk/debian



Author: branden
Date: 2003-08-01 13:13:08 -0500 (Fri, 01 Aug 2003)
New Revision: 353

Modified:
   trunk/debian/changelog
   trunk/debian/xserver-common.config.in
Log:
debian/xserver-common.config.in: if the user is running Linux > 2.5 at the
    time this package is configured for the first time, set the default
    nice value to 0 instead of -10

    update copyright notice


Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	2003-08-01 18:11:00 UTC (rev 352)
+++ trunk/debian/changelog	2003-08-01 18:13:08 UTC (rev 353)
@@ -71,8 +71,12 @@
     discover trick wc into interpreting a blank line as a detected video card
     (based on a patch by Nikita V. Youshchenko -- thanks!) (Closes: #195418)
 
- -- Branden Robinson <branden@debian.org>  Fri,  1 Aug 2003 13:05:57 -0500
+  * debian/xserver-common.config.in: if the user is running Linux > 2.5 at the
+    time this package is configured for the first time, set the default nice
+    value to 0 instead of -10
 
+ -- Branden Robinson <branden@debian.org>  Fri,  1 Aug 2003 13:11:48 -0500
+
 xfree86 (4.2.1-9) unstable; urgency=high
 
   * urgency due to xterm security fixes; see below

Modified: trunk/debian/xserver-common.config.in
==============================================================================
--- trunk/debian/xserver-common.config.in	2003-08-01 18:11:00 UTC (rev 352)
+++ trunk/debian/xserver-common.config.in	2003-08-01 18:13:08 UTC (rev 353)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Debian xserver-common package configuration script
-# Copyright 2000-2002 Branden Robinson.
+# Copyright 2000--2003 Branden Robinson.
 # Licensed under the GNU General Public License, version 2.  See the file
 # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
 
@@ -13,6 +13,19 @@
 
 CONFIGFILE=/etc/X11/Xwrapper.config
 
+# set the default nice value based on what Linux kernel version is being used;
+# the new process scheduler in 2.5, to be released in 2.6, makes a default of
+# -10 a bad idea; with that scheduler, the X server should run with priority 0
+NICE_DEFAULT=-10
+if [ "$(uname -s)" = "Linux" ]; then
+  LINUX_KERNEL_FLAVOR=$(uname -r)
+  LINUX_KERNEL_VERSION=${LINUX_KERNEL_FLAVOR%%-*}
+  # it kinda sucks that I have to use dpkg for this
+  if dpkg --compare-versions "$LINUX_KERNEL_VERSION" gt "2.5"; then
+    NICE_DEFAULT=0
+  fi
+fi
+
 checkval () {
   set +e
   VALID=
@@ -93,7 +106,7 @@
 # make sure it's really safe
 checkval "$RET"
 if [ -z "$VALID" ]; then
-  SAFE=-10
+  SAFE="$NICE_DEFAULT"
   db_set xserver-common/xwrapper/nice_value "$SAFE"
 fi
 set +e



Reply to: