Bug 771543 - for loop in section 2.9.2 removes tasks already found in a subgroup
Summary: for loop in section 2.9.2 removes tasks already found in a subgroup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: doc-Resource_Management_Guide
Version: 6.2
Hardware: All
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Martin Prpič
QA Contact: ecs-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-04 02:23 UTC by joja
Modified: 2012-06-25 10:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-25 10:06:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description joja 2012-01-04 02:23:39 UTC
Section 2.9.2, reads:

Therefore, it is advisable to move all processes from the root group to a specific subgroup when using the blkio and cpu configuration options which divide an available resource based on a weight or a share (for example, cpu.shares or blkio.weight). To move all tasks from the root group into a specific subgroup, you can use the following command:

rootgroup]# for i in `cat tasks`; do echo $i > red/tasks; done


The for loop above suffer from two issues:
1) It copies the tasks from root group to subgroup rather than moving them.
2) It overrides any tasks in the subgroup.

To avoid these, I suggest the code would become:

rootgroup]# for i in `cat tasks`; do echo $i >> red/tasks; done
rootgroup]# echo '' > tasks

That's all.

Comment 2 Jaromir Hradilek 2012-01-09 21:43:02 UTC
Thank you very much for taking the time to report this issue, I will fix this as soon as possible.

Comment 5 Martin Prpič 2012-06-25 10:06:45 UTC
Fix available on docs.redhat.com. Closing!


Note You need to log in before you can comment on or make changes to this bug.