rpms/irqbalance/devel irqbalance-0.55-pid-file.patch, NONE, 1.1 irqbalance.init, 1.9, 1.10 irqbalance.spec, 1.47, 1.48
Neil Horman (nhorman)
fedora-extras-commits at redhat.com
Mon Nov 5 12:59:46 UTC 2007
- Previous message (by thread): rpms/tzdata/devel tzdata.spec,1.53,1.54
- Next message (by thread): rpms/dialog/devel dialog-1.1-20071028-libs.patch, NONE, 1.1 dialog-1.1-20071028-multilib.patch, NONE, 1.1 .cvsignore, 1.21, 1.22 dialog.spec, 1.29, 1.30 sources, 1.21, 1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: nhorman
Update of /cvs/extras/rpms/irqbalance/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6423
Modified Files:
irqbalance.init irqbalance.spec
Added Files:
irqbalance-0.55-pid-file.patch
Log Message:
Resolves: bz 355231
irqbalance-0.55-pid-file.patch:
--- NEW FILE irqbalance-0.55-pid-file.patch ---
diff -up irqbalance-0.55/irqbalance-0.55/irqbalance.c.orig irqbalance-0.55/irqbalance-0.55/irqbalance.c
--- irqbalance-0.55/irqbalance-0.55/irqbalance.c.orig 2007-11-01 11:43:24.000000000 -0400
+++ irqbalance-0.55/irqbalance-0.55/irqbalance.c 2007-11-01 15:00:53.000000000 -0400
@@ -22,7 +22,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
+#include <fcntl.h>
+#include <string.h>
#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include "irqbalance.h"
@@ -52,6 +56,9 @@ void sleep_approx(int seconds)
int main(int argc, char** argv)
{
+ int pidf;
+ char buf[16];
+
if (argc>1 && strstr(argv[1],"debug"))
debug_mode=1;
if (argc>1 && strstr(argv[1],"oneshot"))
@@ -67,9 +74,6 @@ int main(int argc, char** argv)
if (getenv("IRQBALANCE_DEBUG"))
debug_mode=1;
- parse_cpu_tree();
-
-
/* On single core UP systems irqbalance obviously has no work to do */
if (core_count<2)
exit(EXIT_SUCCESS);
@@ -82,6 +86,19 @@ int main(int argc, char** argv)
if (daemon(0,0))
exit(EXIT_FAILURE);
+ pidf = open("/var/run/irqbalance.pid",O_RDWR|O_CREAT|O_EXCL,0666);
+ if (pidf < 0)
+ exit(EXIT_FAILURE);
+
+ snprintf(buf, 16, "%d", getpid());
+ if (write(pidf, buf, strlen(buf)) < strlen(buf)) {
+ close(pidf);
+ unlink("/var/run/irqbalance.pid");
+ exit(EXIT_FAILURE);
+ }
+
+ close(pidf);
+
parse_proc_interrupts();
sleep(SLEEP_INTERVAL/4);
reset_counts();
@@ -134,5 +151,8 @@ int main(int argc, char** argv)
break;
counter++;
}
+
+ unlink("/var/run/irqbalance.pid");
+
return EXIT_SUCCESS;
}
Index: irqbalance.init
===================================================================
RCS file: /cvs/extras/rpms/irqbalance/devel/irqbalance.init,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- irqbalance.init 4 Oct 2007 15:59:37 -0000 1.9
+++ irqbalance.init 5 Nov 2007 12:59:14 -0000 1.10
@@ -46,7 +46,7 @@
RETVAL=0
start() {
- if [ -n "$ONESHOT" -a -f /var/lock/subsys/irqbalance ]; then
+ if [ -n "$ONESHOT" -a -f /var/run/irqbalance.pid ]; then
exit 0
fi
echo -n $"Starting $prog: "
@@ -54,12 +54,9 @@
then
export IRQBALANCE_BANNED_CPUS=$IRQ_AFFINITY_MASK
fi
- daemon irqbalance $ONESHOT $IRQ_AFFINITY
+ daemon irqbalance $ONESHOT
RETVAL=$?
echo
- if [ $RETVAL -eq 0 ]; then
- touch /var/lock/subsys/irqbalance
- fi
return $RETVAL
}
Index: irqbalance.spec
===================================================================
RCS file: /cvs/extras/rpms/irqbalance/devel/irqbalance.spec,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- irqbalance.spec 4 Oct 2007 15:59:37 -0000 1.47
+++ irqbalance.spec 5 Nov 2007 12:59:14 -0000 1.48
@@ -1,7 +1,7 @@
Summary: IRQ balancing daemon.
Name: irqbalance
Version: 0.55
-Release: 6%{?dist}
+Release: 7%{?dist}
Epoch: 2
Group: System Environment/Base
License: GPL/OSL
@@ -19,6 +19,7 @@
Patch0: irqbalance-pie.patch
Patch1: irqbalance-0.55-cputree-parse.patch
+Patch2: irqbalance-0.55-pid-file.patch
%description
irqbalance is a daemon that evenly distributes IRQ load across
@@ -29,6 +30,7 @@
#%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
rm -rf $RPM_BUILD_ROOT
@@ -76,6 +78,9 @@
%changelog
+* Thu Nov 01 2007 Neil Horman <nhorman at redhat.com> - 2:0.55-7
+- Update to properly hadndle pid files (bz 355231)
+
* Thu Oct 04 2007 Neil Horman <nhorman at redhat.com> - 2:0.55-6
- Fix irqbalance init script (bz 317219)
- Previous message (by thread): rpms/tzdata/devel tzdata.spec,1.53,1.54
- Next message (by thread): rpms/dialog/devel dialog-1.1-20071028-libs.patch, NONE, 1.1 dialog-1.1-20071028-multilib.patch, NONE, 1.1 .cvsignore, 1.21, 1.22 dialog.spec, 1.29, 1.30 sources, 1.21, 1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list