home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20120521.etc.tar.gz / bradford.20120521.etc.tar / etc / init.d / irq_balancer < prev    next >
Text File  |  2006-05-03  |  2KB  |  93 lines

  1. #! /bin/sh
  2. # Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
  3. # All rights reserved.
  4. #
  5. # /etc/init.d/irqbalance
  6. #   and its symbolic link
  7. # /(usr/)sbin/rcirqbalance
  8. #
  9. ### BEGIN INIT INFO
  10. # Provides:          irqbalance
  11. # Required-Start:    
  12. # X-UnitedLinux-Should-Start: 
  13. # Required-Stop:     
  14. # X-UnitedLinux-Should-Stop: 
  15. # Default-Start:     1 2 3 5
  16. # Default-Stop:      0 6
  17. # Short-Description: irqbalance daemon providing irq balancing on MP-machines
  18. # Description:       Start irqbalance to allow interrrupt balancing over multiple CPUs
  19. #                 usually all irqs are handled by cpu0, this daemon dynamcally 
  20. #                 uses all cpus for the irqs
  21. #    
  22. #    
  23. #    
  24. ### END INIT INFO
  25.  
  26. # Check for missing binaries (stale symlinks should not happen)
  27. IRQBALANCE_BIN=/usr/sbin/irqbalance
  28. test -x $IRQBALANCE_BIN || exit 5
  29. NUM_CPU=`/usr/bin/getconf _NPROCESSORS_ONLN`
  30. PHYS=$(grep "physical id" /proc/cpuinfo  | sort | uniq | wc -l)
  31. PROC=$(grep -c processor /proc/cpuinfo)
  32.  
  33. . /etc/rc.status
  34.  
  35. # Reset status of this service
  36. rc_reset
  37.  
  38. case "$1" in
  39.     start)
  40.     echo -n "Starting irqbalance "
  41.     if [ $PHYS -gt 1 -o \( $PROC -gt 1 -a $PHYS -eq 0 \) ] ; then
  42.         startproc $IRQBALANCE_BIN
  43.         # Remember status and be verbose
  44.         rc_status -v
  45.     else
  46.         rc_status -u
  47.     fi
  48.     ;;
  49.     stop)
  50.     echo -n "Shutting down irqbalance "
  51.     killproc -TERM $IRQBALANCE_BIN
  52.  
  53.     # Remember status and be verbose
  54.     rc_status -v
  55.     ;;
  56.     try-restart)
  57.     $0 status >/dev/null &&  $0 restart
  58.  
  59.     # Remember status and be quiet
  60.     rc_status
  61.     ;;
  62.     restart)
  63.     $0 stop
  64.     $0 start
  65.  
  66.     # Remember status and be quiet
  67.     rc_status
  68.     ;;
  69.     force-reload|reload)
  70.     echo -n "Reload service irqbalance "
  71.     if [ $PHYS -gt 1 -o \( $PROC -gt 1 -a $PHYS -eq 0 \) ] ; then
  72.         ## if it supports it:
  73.         killproc -HUP $IRQBALANCE_BIN
  74.         #touch /var/run/irqbalance.pid
  75.         rc_status -v
  76.     else
  77.         rc_status -u
  78.     fi
  79.     ;;
  80.     status)
  81.     echo -n "Checking for service irqbalance "
  82.     checkproc $IRQBALANCE_BIN
  83.     rc_status -v
  84.     ;;
  85.     probe)
  86.     ;;
  87.     *)
  88.     echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
  89.     exit 1
  90.     ;;
  91. esac
  92. rc_exit
  93.