Ticket #933: boinc-client.patch

File boinc-client.patch, 1.8 KB (added by misterc, 15 years ago)
  • boinc-client

    old new  
    2727BOINC_USER=boinc
    2828BOINC_DIR=/var/lib/boinc-client
    2929BOINC_CLIENT=/usr/bin/boinc
     30BOINC_OOM_ADJ=15
    3031
    3132# Source defaults file. Edit that file to configure this script.
    3233if [ -e /etc/default/boinc-client ]; then
     
    121122      fi
    122123    fi
    123124
     125    children=`ps --ppid $pid -o pid= | tr '\n' ' '`
     126
    124127    if [ ! -x "`which schedtool 2>/dev/null`" ]; then
    125128      log_progress_msg "schedtool not found"
    126129    else
    127       children=`ps --ppid $pid -o pid= | tr '\n' ' '`
    128130      (schedtool -n 19 -D $pid $children >/dev/null \
    129131        && log_progress_msg "idleprio") || \
    130132      (schedtool -n 19 -B $pid $children >/dev/null \
     
    132134      (schedtool -n 19 -N $pid $children >/dev/null \
    133135        && log_progress_msg "normal")
    134136    fi
     137
     138    for BPID in ${pid} ${children}; do echo ${BOINC_OOM_ADJ} > /proc/${BPID}/oom_adj; echo; done
    135139  fi
    136140  log_end_msg 0
    137141}
     
    141145  STATUS="Status of $DESC:"
    142146  if is_running; then
    143147    log_success_msg "$STATUS running."
     148
     149    children=`ps --ppid $pid -o pid= | tr '\n' ' '`
    144150    if [ -x "`which schedtool 2>/dev/null`" ]; then
    145151      log_success_msg "Scheduling of $DESC:"
    146152      schedtool $pid
    147153
    148       children=`ps --ppid $pid -o pid= | tr '\n' ' '`
    149154      if [ -n "$children" ]; then
    150155        log_success_msg "Scheduling of $DESC's children:"
    151156        schedtool $children
    152157      fi
    153158    fi
    154159
     160    log_success_msg "OOM killer status for $DESC:"
     161    for BPID in ${pid} ${children}; do echo PID ${BPID}: adj `cat /proc/${BPID}/oom_adj`, score `cat /proc/${BPID}/oom_score`; done
     162
    155163    # Display $BOINC_USER's cpu_share:
    156164    uid=`id -u $BOINC_USER`
    157165    cpu_share_file="/sys/kernel/uids/$uid/cpu_share"