Changes between Version 30 and Version 31 of TipAndDoc/Linux/LXC


Ignore:
Timestamp:
May 5, 2013 12:05:28 AM (12 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TipAndDoc/Linux/LXC

    v30 v31  
    517517  * Debian Squeezeと異なり、Ubuntu 12.04では{{{lxc-cgroup -t container_name tasks}}}が使えない 
    518518 
     519 * https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt 
     520 > Each cgroup is represented by a directory in the cgroup file system 
     521 > containing the following files describing that cgroup: 
     522 >  
     523 >  - tasks: list of tasks (by pid) attached to that cgroup.  This list 
     524 >    is not guaranteed to be sorted.  Writing a thread id into this file 
     525 >    moves the thread into this cgroup. 
     526 >  - cgroup.procs: list of tgids in the cgroup.  This list is not 
     527 >    guaranteed to be sorted or free of duplicate tgids, and userspace 
     528 >    should sort/uniquify the list if this property is required. 
     529 >    Writing a thread group id into this file moves all threads in that 
     530 >    group into this cgroup. 
     531 >  - notify_on_release flag: run the release agent on exit? 
     532 >  - release_agent: the path to use for release notifications (this file 
     533 >    exists in the top cgroup only) 
     534 
    519535 === Debian 6.0 === 
    520536 * http://wiki.debian.org/LXC 
     
    529545 
    530546 * $ sudo lxc-start -d -n lxc-test 
     547 * $ sudo lxc-cgroup -n lxc-test tasks 
     548{{{ 
     5491432 
     5501569 
     5511571 
     5521598 
     553}}} 
     554 
    531555 * $ ls -1F /sys/fs/cgroup/ 
    532556{{{ 
     
    558582}}} 
    559583  * /sys/fs/cgroup/lxc-test/ も同じ構造 
    560  * $ sudo lxc-cgroup -n lxc-test tasks 
     584 * $ cat /sys/fs/cgroup/lxc-test/tasks 
    561585{{{ 
    5625861432 
     
    569593 * Ubuntu 12.04 with {{{aptitude install -R lxc}}} 
    570594  * cgroup関係のパッケージは{{{-R}}}をつけるとインストールされない 
    571  
    572  
     595 * $ ls -1F /sys/fs/cgroup/ 
     596  * N/A 
     597 * $ sudo lxc-start -n lxc-test 
     598{{{ 
     599lxc-start: failed to spawn 'lxc-test' 
     600}}} 
     601 
     602 ==== /etc/fstab ==== 
    573603 * Ubuntu 12.04 with /etc/fstab:{{{cgroup  /sys/fs/cgroup  cgroup  defaults  0   0}}} 
    574604  * 起動時に自動でマウントされないため、{{{mount -a}}}する必要がある 
     605 
    575606 * $ sudo mount -a 
     607 * $ sudo lxc-start -d -n lxc-test 
     608 * $ sudo lxc-cgroup -n lxc-test tasks 
     609{{{ 
     610lxc-cgroup: cgroup is not mounted 
     611lxc-cgroup: failed to retrieve value of 'tasks' for 'lxc-test' 
     612}}} 
     613 
    576614 * $ ls -1F /sys/fs/cgroup/ 
    577615{{{ 
     
    657695}}} 
    658696  * /sys/fs/cgroup/lxc/, /sys/fs/cgroup/lxc/lxc-test/ も同じ構造 
    659  * $ sudo lxc-cgroup -n lxc-test tasks 
    660 {{{ 
    661 lxc-cgroup: cgroup is not mounted 
    662 lxc-cgroup: failed to retrieve value of 'tasks' for 'lxc-test' 
    663 }}} 
    664697 * $ cat /sys/fs/cgroup/lxc/lxc-test/tasks 
    665698{{{ 
     
    6817143058 
    682715}}} 
     716 
     717 ==== cgroup-lite ==== 
     718 * Ubuntu 12.04 with {{{cgroup-lite}}} 
     719  * aptitude install時に-Rとしない場合、{{{cgroup-lite}}}がRecommendsからインストールされる 
     720  * /bin/cgroups-mount 
     721{{{ 
     722mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup 
     723}}} 
     724 * $ sudo lxc-cgroup -n lxc-test tasks 
     725{{{ 
     726lxc-cgroup: cgroup is not mounted 
     727lxc-cgroup: failed to retrieve value of 'tasks' for 'lxc-test' 
     728}}} 
     729 
     730 * $ ls -1F /sys/fs/cgroup/ 
     731{{{ 
     732blkio/ 
     733cpu/ 
     734cpuacct/ 
     735cpuset/ 
     736devices/ 
     737freezer/ 
     738memory/ 
     739perf_event/ 
     740}}} 
     741  * $ find /sys/fs/cgroup/ | grep lxc-test/tasks | xargs wc 
     742{{{ 
     74317 17 102 /sys/fs/cgroup/perf_event/lxc/lxc-test/tasks 
     74417 17 102 /sys/fs/cgroup/blkio/lxc/lxc-test/tasks 
     74517 17 102 /sys/fs/cgroup/freezer/lxc/lxc-test/tasks 
     74617 17 102 /sys/fs/cgroup/devices/lxc/lxc-test/tasks 
     74717 17 102 /sys/fs/cgroup/memory/lxc/lxc-test/tasks 
     74817 17 102 /sys/fs/cgroup/cpuacct/lxc/lxc-test/tasks 
     74917 17 102 /sys/fs/cgroup/cpu/lxc/lxc-test/tasks 
     75017 17 102 /sys/fs/cgroup/cpuset/lxc/lxc-test/tasks 
     751}}} 
     752 * $ cat /sys/fs/cgroup/perf_event/lxc/lxc-test/tasks 
     753{{{ 
     75417390 
     75517539 
     75617556 
     75717560 
     75817562 
     75917567 
     76017568 
     76117570 
     76217599 
     76317621 
     76417647 
     76517651 
     76617654 
     76717659 
     76817678 
     76917681 
     77017829 
     771}}} 
     772 
     773 ==== cgroup-bin ==== 
     774 * Ubuntu 12.04 with {{{cgroup-bin}}} 
     775  * cgroup-binとcgroup-liteはコンフリクトする 
     776  * /etc/init/cgconfig.conf 
     777{{{ 
     778mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroups /sys/fs/cgroup 
     779}}} 
     780 * $ sudo lxc-cgroup -n lxc-test tasks 
     781{{{ 
     782lxc-cgroup: cgroup is not mounted 
     783lxc-cgroup: failed to retrieve value of 'tasks' for 'lxc-test' 
     784}}} 
     785 
     786 * $ ls -1F /sys/fs/cgroup/ 
     787{{{ 
     788cpu/ 
     789cpuacct/ 
     790devices/ 
     791freezer/ 
     792memory/ 
     793}}} 
     794  * $ find /sys/fs/cgroup/ | grep lxc-test/tasks | xargs wc 
     795{{{ 
     79616 16 80 /sys/fs/cgroup/freezer/sysdefault/lxc/lxc-test/tasks 
     79716 16 80 /sys/fs/cgroup/memory/sysdefault/lxc/lxc-test/tasks 
     79816 16 80 /sys/fs/cgroup/devices/sysdefault/lxc/lxc-test/tasks 
     79916 16 80 /sys/fs/cgroup/cpuacct/sysdefault/lxc/lxc-test/tasks 
     80016 16 80 /sys/fs/cgroup/cpu/sysdefault/lxc/lxc-test/tasks 
     801}}} 
     802 * $ cat /sys/fs/cgroup/freezer/sysdefault/lxc/lxc-test/tasks 
     803{{{ 
     8041296 
     8051390 
     8061434 
     8071461 
     8081470 
     8091471 
     8101473 
     8111474 
     8121502 
     8131524 
     8141552 
     8151562 
     8161563 
     8171566 
     8181580 
     8191582 
     820}}}