diff --git a/.cvsignore b/.cvsignore index e69de29..38a38d0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +irqbalance-0.12.tar.gz diff --git a/irqbalance.init b/irqbalance.init new file mode 100755 index 0000000..ada9c68 --- /dev/null +++ b/irqbalance.init @@ -0,0 +1,91 @@ +#! /bin/sh +# +# irqbalance Start/Stop irq balancing daemon +# +# chkconfig: 345 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 + + +# This is an interactive program, we need the current locale + +# Source function library. +. /etc/init.d/functions + +# Check that we're a priviledged user +[ `id -u` = 0 ] || exit 0 + + +prog="irqbalance" + +# Check that networking is up. +if [ "$NETWORKING" = "no" ] +then + exit 0 +fi + +[ -f /usr/sbin/irqbalance ] || exit 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 + +RETVAL=0 + +start() { + echo -n $"Starting $prog: " + daemon irqbalance $ONESHOT + RETVAL=$? + echo + [ $RETVAL -eq 0 -a -n "$ONESHOT" ] && touch /var/lock/subsys/irqbalance + return $RETVAL +} + + +stop() { + echo -n $"Stopping $prog: " + killproc irqbalance + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/irqbalance + return $RETVAL +} + +restart() { + stop + start +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status irqbalance + ;; + restart|reload) + restart + ;; + condrestart) + [ -f /var/lock/subsys/irqbalance ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" + exit 1 +esac + +exit $? diff --git a/irqbalance.spec b/irqbalance.spec new file mode 100644 index 0000000..4608c70 --- /dev/null +++ b/irqbalance.spec @@ -0,0 +1,67 @@ +Summary: IRQ balancing daemon. +Name: irqbalance +Version: 1.12 +Release: %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?}) +Serial: 1 +Group: System Environment/Base +License: GPL/OSL +Source0: irqbalance-0.12.tar.gz +Source1: irqbalance.init +Source2: irqbalance.sysconfig +Buildroot: %{_tmppath}/%{name}-%{version}-root +Prereq: /sbin/chkconfig /sbin/service +Patch1: irqbalance-pie.patch +ExclusiveArch: i386 x86_64 ia64 + +%description +irqbalance is a daemon that evenly distributes IRQ load across +multiple CPUs for enhanced performance. + +%prep +%setup -q -c -a 0 +%patch1 -p1 + +%build +rm -rf $RPM_BUILD_ROOT + +mkdir -p %{buildroot}/usr/sbin +mkdir -p %{buildroot}/usr/man +mkdir -p %{buildroot}/etc/rc.d/init.d +mkdir -p %{buildroot}/etc/sysconfig + +cd irqbalance +make + +%install +mkdir -p %{buildroot}/usr/share/man/man{1,8} + +cd irqbalance +install irqbalance %{buildroot}/usr/sbin +install %{SOURCE91} %{buildroot}/etc/rc.d/init.d/irqbalance +install %{SOURCE92} %{buildroot}/etc/sysconfig/irqbalance +install irqbalance.1 %{buildroot}/usr/share/man/man1/ + +chmod -R a-s %{buildroot} + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; + +%files +%defattr(-,root,root) +/usr/sbin/irqbalance +%attr(0644,root,root) %{_mandir}/*/* +/etc/rc.d/init.d/irqbalance +%attr(0644,root,root) /etc/sysconfig/irqbalance + +%preun +if [ "$1" = "0" ] ; then + /sbin/chkconfig --del irqbalance +fi + +%post +/sbin/chkconfig --add irqbalance + +%changelog +* Sat Dec 18 2004 Dave Jones +- Initial packaging, based on kernel-utils. + diff --git a/irqbalance.sysconfig b/irqbalance.sysconfig new file mode 100755 index 0000000..158c3b9 --- /dev/null +++ b/irqbalance.sysconfig @@ -0,0 +1,9 @@ +# irqbalance is a daemon process that distributes interrupts across +# CPUS on SMP systems. The default is to rebalance once every 10 +# seconds. There is one configuration option: +# +# ONESHOT=yes +# after starting, wait for a minute, then look at the interrupt +# load and balance it once; after balancing exit and do not change +# it again. +ONESHOT= diff --git a/sources b/sources index e69de29..69aeb84 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +1f225b73a01380955231b77d9be60c7a irqbalance-0.12.tar.gz