Ahh... I forgot to tell that I've already patched this bug in my modified CPUstress image v2.1expl3.
Patch is attached below. Basically I added two trap commands to catch the signals generated by Ctrl+C and Ctrl+\, and finally release them.
Patch is attached below. Basically I added two trap commands to catch the signals generated by Ctrl+C and Ctrl+\, and finally release them.
Code:
--- initrd-old/usr/local/bin/cpuburn 2012-10-21 22:49:42.458631019 +0800
+++ initrd-new/usr/local/bin/cpuburn 2012-10-21 22:53:25.106636051 +0800
@@ -23,7 +23,8 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
-# Last updated by Gert Hulselmans on 26 February 2009.
+# Last updated by Gert Hulselmans on 7 September 2012.
+# Patched by Explorer to fix a "Ctrl+C" bug and terminate cpuburn-in properly.
CPUS=`awk '/^processor/ {CPU=$3}; END {print CPU+1}' /proc/cpuinfo`
@@ -65,7 +66,9 @@
/opt/cpuburn/cpuburn-in $time &
done
+ trap 'pkill cpuburn-in; trap - 2 3; exit' 2 3
read -s -n1
pkill cpuburn-in
+ trap - 2 3
fi
+++ initrd-new/usr/local/bin/cpuburn 2012-10-21 22:53:25.106636051 +0800
@@ -23,7 +23,8 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
-# Last updated by Gert Hulselmans on 26 February 2009.
+# Last updated by Gert Hulselmans on 7 September 2012.
+# Patched by Explorer to fix a "Ctrl+C" bug and terminate cpuburn-in properly.
CPUS=`awk '/^processor/ {CPU=$3}; END {print CPU+1}' /proc/cpuinfo`
@@ -65,7 +66,9 @@
/opt/cpuburn/cpuburn-in $time &
done
+ trap 'pkill cpuburn-in; trap - 2 3; exit' 2 3
read -s -n1
pkill cpuburn-in
+ trap - 2 3
fi