r695 - in /trunk/boinc/debian: boinc-client.init changelog control

fst-guest at users.alioth.debian.org fst-guest at users.alioth.debian.org
Sat Aug 18 13:27:11 UTC 2007


Author: fst-guest
Date: Sat Aug 18 13:27:10 2007
New Revision: 695

URL: http://svn.debian.org/wsvn/pkg-boinc/?sc=1&rev=695
Log:
Applied Omen Wild's patch for advanced scheduling.

Modified:
    trunk/boinc/debian/boinc-client.init
    trunk/boinc/debian/changelog
    trunk/boinc/debian/control

Modified: trunk/boinc/debian/boinc-client.init
URL: http://svn.debian.org/wsvn/pkg-boinc/trunk/boinc/debian/boinc-client.init?rev=695&op=diff
==============================================================================
--- trunk/boinc/debian/boinc-client.init (original)
+++ trunk/boinc/debian/boinc-client.init Sat Aug 18 13:27:10 2007
@@ -32,7 +32,7 @@
 test "$ENABLED" != "0" || exit 0
 
 if [ ! -x "$BOINC_CLIENT" ]; then
-  log_failure_msg "BOINC client '$BOINC_CLIENT' does not exist or is not " \
+  log_failure_msg "BOINC client '$BOINC_CLIENT' does not exist or is not" \
     "executable."
   exit 5
 fi
@@ -43,7 +43,7 @@
 fi
 
 if [ -z "$BOINC_USER" ]; then
-  log_failure_msg "BOINC_USER variable is empty. Set it to a user to run " \
+  log_failure_msg "BOINC_USER variable is empty. Set it to a user to run" \
     "the BOINC core client."
   exit 6
 fi
@@ -73,8 +73,8 @@
     log_progress_msg "already running"
   else
     start-stop-daemon --start --quiet --background --pidfile $PIDFILE \
-      --make-pidfile --user $BOINC_USER --chuid $BOINC_USER --chdir $BOINC_DIR \
-      --exec $BOINC_CLIENT -- $BOINC_OPTS
+      --make-pidfile --user $BOINC_USER --chuid $BOINC_USER \
+      --chdir $BOINC_DIR --exec $BOINC_CLIENT -- $BOINC_OPTS
   fi
   log_end_msg 0
 }
@@ -94,11 +94,60 @@
   log_end_msg 0
 }
 
+schedule()
+{
+  log_begin_msg "Setting up scheduling for $DESC and children:"
+
+  if ! is_running; then
+    log_progress_msg "not running"
+    log_end_msg 0
+  else
+    if [ -z $pid ]; then
+      log_failure_msg "unable to find pid to do scheduling."
+      return 1
+    fi
+
+    if [ ! -x "`which ionice 2>/dev/null`" ]; then
+      log_progress_msg "no ionice in the path,"
+    else
+      ionice -n 4 -c 3 -p $pid
+      log_progress_msg "ioniced,"
+    fi
+
+    if [ ! -x "`which schedtool 2>/dev/null`" ]; then
+      log_progress_msg "no schedtool in the path"
+    else
+      max=5
+      while [ "x$children" = "x" ] && [ $max -ge 0 ]; do
+        children=$(ps --ppid $pid -opid= | tr '\n' ' ' || true)
+        [ "x$children" = "x" ] && sleep 1
+        max=$(expr $max - 1)
+      done
+
+      if [ "x$children" != "x" ]; then
+        ( schedtool -n 19 -D $pid $children >/dev/null && log_progress_msg "idleprio") || \
+         (schedtool -n 19 -B $pid $children >/dev/null && log_progress_msg "batch" ) || \
+         (schedtool -n 19    $pid $children            && log_progress_msg "only niced")
+      else
+        log_progress_msg "unable to find any children"
+      fi
+    fi
+
+    log_end_msg 0
+  fi
+}
+
 status()
 {
   STATUS="Status of $DESC:"
   if is_running; then
     log_success_msg "$STATUS running."
+    if [ -x "`which schedtool 2>/dev/null`" ]; then
+      log_success_msg "Scheduling of $DESC:"
+      schedtool $pid
+      log_success_msg "Scheduling of $DESC's children:"
+      schedtool $(ps --ppid $pid -o pid=)
+    fi
   else
     log_success_msg "$STATUS stopped."
   fi
@@ -123,8 +172,12 @@
     status
     ;;
 
+  schedule)
+    schedule
+    ;;
+
   *)
-    log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}" >&2
+    log_success_msg "Usage: $0 {start|stop|restart|force-reload|status|schedule}" >&2
     exit 1
     ;;
 esac

Modified: trunk/boinc/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-boinc/trunk/boinc/debian/changelog?rev=695&op=diff
==============================================================================
--- trunk/boinc/debian/changelog (original)
+++ trunk/boinc/debian/changelog Sat Aug 18 13:27:10 2007
@@ -6,13 +6,21 @@
   * debian/boinc-manager.menu: Changed section for the new menu hierarchy from
     "Apps/Tools" to "Applications/System/Monitoring".
   * debian/icons/: Updated icons to the new BOINC logo.
+  * debian/boinc-client.init: Added patch to use advanced scheduling for the
+    client and it's children using the schedtool and ionice utilities. For now
+    advanced scheduling is disabled by default. Invoke the init script with
+    the schedule option to enable it. Thanks to Omen Wild
+    <dbug4.flibble at mandarb.com> for the patch. (closes: #423259)
+  * debian/control: Added schedtool, which if installed can be used for
+    advanced scheduling in boinc-client's init script, to boinc-client's
+    Suggest field.
 
   [ Debconf translations ]
   * Added Spanish (es.po) by Javier Fernández-Sanguino Peña
     <jfs at computer.org>. (closes: #437379)
   * Added Slovak (sk.po) by helix84 <helix84 at centrum.sk>. (closes: #437670)
 
- -- Frank S. Thomas <frank at thomas-alfeld.de>  Wed, 15 Aug 2007 09:11:46 +0200
+ -- Frank S. Thomas <frank at thomas-alfeld.de>  Sat, 18 Aug 2007 14:38:24 +0200
 
 boinc (5.10.8-1) unstable; urgency=low
 

Modified: trunk/boinc/debian/control
URL: http://svn.debian.org/wsvn/pkg-boinc/trunk/boinc/debian/control?rev=695&op=diff
==============================================================================
--- trunk/boinc/debian/control (original)
+++ trunk/boinc/debian/control Sat Aug 18 13:27:10 2007
@@ -12,7 +12,7 @@
 Section: net
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, python (>= 2.3), adduser, lsb-base (>= 3.0-6), ca-certificates
-Suggests: boinc-app-seti, boinc-manager | kboincspy
+Suggests: boinc-app-seti, boinc-manager | kboincspy, schedtool
 Description: core client for the BOINC distributed computing infrastructure
  The Berkeley Open Infrastructure for Network Computing (BOINC) is a
  software platform for distributed computing: several initiatives of




More information about the pkg-boinc-commits mailing list