Difference between revisions of "VCMD HowTo"

From Linux-VServer

Jump to: navigation, search
m (Linux-VServer-Hacks moved to VCMD HowTo: needed a more descriptive name, should be extended with some introduction to vcmd)
m (spelling)
 
(6 intermediate revisions by 4 users not shown)
Line 6: Line 6:
 
* create a virtualized init task
 
* create a virtualized init task
 
: <pre>vcmd -i 100 -BC ctx_create .flagword=^34^33^32^4 -- vcmd -i -1 -BC set_cflags .mask=^33 -- cat /proc/self/status</pre>
 
: <pre>vcmd -i 100 -BC ctx_create .flagword=^34^33^32^4 -- vcmd -i -1 -BC set_cflags .mask=^33 -- cat /proc/self/status</pre>
 +
 +
* set context 100 dentry (hard) limit (22) to 4000
 +
: <pre>vcmd -i 100 -BC set_rlimit .id=22 .maximum=4000</pre>
 +
 +
* start a cpuhog with sched_hard (supposed to get 25% by default)
 +
: <pre>vcmd -i 100 -BC ctx_create .flagword=^34^33^32^8 -- cpuhog</pre>
 +
 +
* translate switch debugging to readable names
 +
: <pre>dmesg | while read vxd vc vcmd LINE; do test "$vxd $vc" != "vxD: vc:" && continue; vcmd=${vcmd/,/}; text=`vcmd -d -C "$vcmd" | head -n 1 | sed 's/://'`; test "$text" = "unknown VCMD" && text="$vcmd"; printf "%-30s %s\n" "$text" "$LINE"; done</pre>
 +
 +
[[Category:Documentation]]

Latest revision as of 20:01, 21 October 2011

[edit] VCMD one-liners (by Bertl)

  • create a non virtualized init task
vcmd -i 100 -BC ctx_create .flagword=^34^33^32 -- vcmd -i -1 -BC set_cflags .mask=^33 -- cat /proc/self/status
  • create a virtualized init task
vcmd -i 100 -BC ctx_create .flagword=^34^33^32^4 -- vcmd -i -1 -BC set_cflags .mask=^33 -- cat /proc/self/status
  • set context 100 dentry (hard) limit (22) to 4000
vcmd -i 100 -BC set_rlimit .id=22 .maximum=4000
  • start a cpuhog with sched_hard (supposed to get 25% by default)
vcmd -i 100 -BC ctx_create .flagword=^34^33^32^8 -- cpuhog
  • translate switch debugging to readable names
dmesg | while read vxd vc vcmd LINE; do test "$vxd $vc" != "vxD: vc:" && continue; vcmd=${vcmd/,/}; text=`vcmd -d -C "$vcmd" | head -n 1 | sed 's/://'`; test "$text" = "unknown VCMD" && text="$vcmd"; printf "%-30s %s\n" "$text" "$LINE"; done
Personal tools