Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#! /bin/sh
2
### BEGIN INIT INFO
3
# Provides: irqbalance
4
# Default-Start:  3 4 5
5
# Default-Stop: 0 1 6
6
# Short-Description: start and stop irqbalance daemon
7
# Description:  The irqbalance daemon will distribute interrupts across
8
#		the cpus on a multiprocessor system with the purpose of
9
#		spreading the load
10
### END INIT INFO
11
# chkconfig: 2345 13 87
12
 
13
 
14
# This is an interactive program, we need the current locale
15
 
16
# Source function library.
17
. /etc/init.d/functions
18
 
19
# Check that we're a priviledged user
20
[ `id -u` = 0 ] || exit 0
21
 
22
 
23
prog="irqbalance"
24
 
25
[ -f /usr/sbin/irqbalance ] || exit 0
26
 
27
# fetch configuration if it exists
28
# ONESHOT=yes says to wait for a minute, then look at the interrupt
29
# load and balance it once; after balancing exit and do not change
30
# it again.
31
# The default is to keep rebalancing once every 10 seconds.
32
ONESHOT=
33
[ -f /etc/sysconfig/irqbalance ] && . /etc/sysconfig/irqbalance
34
case "$IRQBALANCE_ONESHOT" in
35
	y*|Y*|on) ONESHOT=--oneshot ;;
36
	*) ONESHOT= ;;
37
esac
38
 
39
RETVAL=0
40
 
41
start() {
42
        if [ -n "$ONESHOT" -a -f /var/run/irqbalance.pid ]; then
43
                exit 0
44
        fi
45
        echo -n $"Starting $prog: "
46
	if [ -n "$IRQBALANCE_BANNED_CPUS" ];
47
	then
48
		export IRQBALANCE_BANNED_CPUS=$IRQBALANCE_BANNED_CPUS
49
	fi
50
        daemon irqbalance --pid=/var/run/irqbalance.pid $IRQBALANCE_ARGS $ONESHOT
51
        RETVAL=$?
52
        echo
53
        return $RETVAL
54
}
55
 
56
 
57
stop() {
58
        echo -n $"Stopping $prog: "
59
        killproc irqbalance
60
        RETVAL=$?
61
        echo
62
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/irqbalance
63
	return $RETVAL
64
}
65
 
66
restart() {
67
	stop
68
	start
69
}
70
 
71
# See how we were called.
72
case "$1" in
73
  start)
74
	start
75
	;;
76
  stop)
77
	stop
78
	;;
79
  status)
80
	status irqbalance
81
	;;
82
  restart|reload|force-reload)
83
	restart
84
	;;
85
  condrestart)
86
	[ -f /var/lock/subsys/irqbalance ] && restart || :
87
	;;
88
  *)
89
	echo $"Usage: $0 {start|stop|status|restart|reload|condrestart|force-reload}"
90
	exit 1
91
	;;
92
esac
93
 
94
exit $?