Skip to contentSkip to conversation

cgroups/cpuacct_setup: fix task_kill() search for process

PATCH In review Jan Stancek 2 participants 2 messages Jun 7, 2011 – Jul 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cgroups/cpuacct_setup: fix task_kill() search for process

1. "i* in "grep cpuacct_taski*" seems pointless as its target is cpuacct_task01

2. using cut fails when ps indents the output as following:
99 cpuacct_task01
112 cpuacct_task01
1111 cpuacct_task01

---
 .../kernel/controllers/cpuacct/cpuacct_setup.sh    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/controllers/cpuacct/cpuacct_setup.sh +1 -1
index 47cd1da..2443a28 100755
@@ -58,7 +58,7 @@ cleanup ()
 }
 task_kill ()
 {
-	for i in `ps -e | grep cpuacct_taski* | cut -d" " -f1`
+	for i in `ps -e | grep cpuacct_task | awk '{print $1}'`
 	do
 		kill -SIGUSR1 $i
 	done

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi!

Quoted 10 lines

1. "i* in "grep cpuacct_taski*" seems pointless as its target is cpuacct_task01

2. using cut fails when ps indents the output as following:
99 cpuacct_task01
112 cpuacct_task01
1111 cpuacct_task01

Commited, thanks.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list