Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37495830
en ru br
ALT Linux repos
S:1.9.2-alt1
5.0: 0.55-alt2
4.1: 0.55-alt1
4.0: 0.12-alt0

Group :: System/Kernel and hardware
RPM: irqbalance

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# irqbalance Start/Stop irq balancing daemon
#
# chkconfig: - 13 87
# description: The irqbalance daemon will distribute interrupts across \
# the cpus on a multiprocessor system with the purpose of \
# spreading the load. \
# processname: irqbalance
# config: /etc/sysconfig/irqbalance
# pidfile: /var/run/irqbalance.pid

### BEGIN INIT INFO
# Provides: irqbalance
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start IRQ balancer
# Description: Enable IRQ balancer.
### END INIT INFO

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

#PIDFILE=/var/run/irqbalance.pid
LOCKFILE=/var/lock/subsys/irqbalance
IRQBALANCE_BIN=/usr/sbin/irqbalance
RETVAL=0

# fetch configuration if it exists
# ONESHOT=yes says to wait for a minute, then look at the interrupt
# load and balance it once; after balancing exit and do not change
# it again.
# The default is to keep rebalancing once every 10 seconds.
ONESHOT=
[ -f /etc/sysconfig/irqbalance ] && . /etc/sysconfig/irqbalance
case "$ONESHOT" in
y*|Y*|on) ONESHOT=--oneshot ;;
*) ONESHOT= ;;
esac


start()
{
start_daemon --lockfile "$LOCKFILE" --expect-user root -- $IRQBALANCE_BIN $ONESHOT
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user root -- $IRQBALANCE_BIN
RETVAL=$?
return $RETVAL
}

restart()
{
stop
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --expect-user root -- $IRQBALANCE_BIN
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac

exit $RETVAL


 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin