Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundację Dzieciom „Zdążyć z Pomocą”.
Więcej informacji na dug.net.pl/pomagamy/.

#1 2018-07-16 10:30:26

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Daemon cgroulesngd nie przydziela.

Demon cgrulesngd nie przypisuje procesow do cgroup/tasks.

Pliki konfigow z mana Ubuntu 16.04.
(cgrup-tools_0.41-7 Ubuntu)
Wiki Archilinux:  https://wiki.archlinux.org/index.php/Cgroups

System:

Kod:

lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:    xenial

Kernel:

Kod:

uname -a
Linux robin-desktop 4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Systemd, wersja:

Kod:

dpkg -l systemd
systemd        229-4ubuntu2 amd64        system and service manager

Systemd podnosi system:

Kod:

ls -l /sbin/init
lrwxrwxrwx 1 root root 20 Mar 15 23:13 /sbin/init -> /lib/systemd/systemd

Iptables zainstalowane:

Kod:

dpkg -l |grep iptables
ii  iptables                                                    1.6.0-2ubuntu3                               amd64        administration tools for packet filtering and NAT
ii  iptables-persistent                                         1.0.4                                        all          boot-time loader for netfilter rules, iptables plugin

Kod:

lsmod | grep iptab
iptable_mangle         16384  1
iptable_nat            16384  1
nf_nat_ipv4            16384  1 iptable_nat
iptable_filter         16384  1
ip_tables              28672  3 iptable_mangle,iptable_filter,iptable_nat
x_tables               40960  12 xt_LOG,ipt_REJECT,iptable_mangle,ip_tables,ebtables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_CHECKSUM,ip6table_filter,xt_conntrack,ip6_tables

Iptables wsparcie dla cgroup:

Kod:

iptables -m cgroup --help | grep cgroup
cgroup match options:
[!] --cgroup fwid  Match cgroup fwid

Netfilter - wsparcie cgroups:

Kod:

grep NETFILTER_XT_MATCH_CGROUP  /boot/config-$(uname -r)
CONFIG_NETFILTER_XT_MATCH_CGROUP=m

Zainstalowane cgroups:

Kod:

dpkg -l | grep cgroup          
ii  cgroup-tools                                                0.41-7ubuntu1                                amd64        control and monitor control groups (tools)

Zamontowane cgroups:

Kod:

 grep cgroup /proc/mounts
tmpfs /sys/fs/cgroup tmpfs rw,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset,clone_children 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma,release_agent=/run/cgmanager/agents/cgm-release-agent.rdma 0 0

Kernel moduly:

Kod:

grep -i cgroup /boot/config-4.15.0-24-generic
CONFIG_CGROUPS=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NET_CLS_CGROUP=m
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y

Cgroups w Kernelu:

Kod:

cat /proc/cgroups
#subsys_name    hierarchy    num_cgroups    enabled
cpuset    2    1    1
cpu    4    90    1
cpuacct    4    90    1
blkio    11    90    1
memory    10    153    1
devices    5    90    1
freezer    7    6    1
net_cls    3    1    1
perf_event    6    1    1
net_prio    3    1    1
hugetlb    8    1    1
pids    9    90    1
rdma    12    1    1

Cgroups dostepne:

Kod:

ls -l /sys/fs/cgroup/
total 0
dr-xr-xr-x 5 root root  0 Jul 16 07:40 blkio
drwxr-xr-x 2 root root 60 Jul 16 07:41 cgmanager
lrwxrwxrwx 1 root root 11 Jul 16 07:40 cpu -> cpu,cpuacct
lrwxrwxrwx 1 root root 11 Jul 16 07:40 cpuacct -> cpu,cpuacct
dr-xr-xr-x 5 root root  0 Jul 16 07:40 cpu,cpuacct
dr-xr-xr-x 2 root root  0 Jul 16 07:40 cpuset
dr-xr-xr-x 5 root root  0 Jul 16 07:40 devices
dr-xr-xr-x 3 root root  0 Jul 16 07:40 freezer
dr-xr-xr-x 2 root root  0 Jul 16 07:40 hugetlb
dr-xr-xr-x 6 root root  0 Jul 16 07:40 memory
lrwxrwxrwx 1 root root 16 Jul 16 07:40 net_cls -> net_cls,net_prio
dr-xr-xr-x 2 root root  0 Jul 16 07:40 net_cls,net_prio
lrwxrwxrwx 1 root root 16 Jul 16 07:40 net_prio -> net_cls,net_prio
dr-xr-xr-x 2 root root  0 Jul 16 07:40 perf_event
dr-xr-xr-x 5 root root  0 Jul 16 07:40 pids
dr-xr-xr-x 2 root root  0 Jul 16 07:40 rdma
dr-xr-xr-x 6 root root  0 Jul 16 07:40 systemd

Cgroups enabled:

Kod:

lxc-checkconfig 
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.15.0-24-generic
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Warning: newuidmap is not setuid-root
Warning: newgidmap is not setuid-root
Network namespace: enabled

--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
FUSE (for use with lxcfs): enabled

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

Cgroups, lokalizacja:

Kod:

lssubsys -am
cpuset /sys/fs/cgroup/cpuset
cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct
blkio /sys/fs/cgroup/blkio
memory /sys/fs/cgroup/memory
devices /sys/fs/cgroup/devices
freezer /sys/fs/cgroup/freezer
net_cls,net_prio /sys/fs/cgroup/net_cls,net_prio
perf_event /sys/fs/cgroup/perf_event
hugetlb /sys/fs/cgroup/hugetlb
pids /sys/fs/cgroup/pids
rdma /sys/fs/cgroup/rdma

File /etc/cgred.conf:

Kod:

# /etc/sysconfig/cgred.conf - CGroup Rules Engine Daemon configuration file
#
# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, LOG) are
# the only valid ones.  Defining anything else in this file will cause the
# CGroup Rules Engine program to fail.  So, don't do it.

# The pathname to the configuration file for CGroup Rules Engine
CONFIG_FILE="/etc/cgrules.conf"

# Uncomment the following line to log to specified file instead of syslog
LOG_FILE="/var/log/cgrulesengd.log"

# Uncomment the second line to run CGroup Rules Engine in non-daemon mode
NODAEMON=""
#NODAEMON="--nodaemon"

# Set owner of cgred socket. 'cgexec' tool should have write access there
# (either using suid and/or sgid permissions or Linux capabilities).
SOCKET_USER=""
SOCKET_GROUP="cgred"

# Uncomment the second line to disable logging for CGroup Rules Engine
# Uncomment the third line to enable more verbose logging.
LOG=""
#LOG="--nolog"
#LOG="-v"

File /etc/cgrules.conf

Kod:

#The format of this file is described in cgrules.conf(5)
#manual page.
#
# Example:
#<user>         <controllers>   <destination>
#@student       cpu,memory      usergroup/student/
#peter          cpu             test1/
#%              memory          test2/
# End of file

Config file: /etc/cgconfig.conf

Kod:

/etc/cgconfig.conf

#
#  Copyright IBM Corporation. 2007
#
#  Authors:    Balbir Singh <balbir@linux.vnet.ibm.com>
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of version 2.1 of the GNU Lesser General Public License
#  as published by the Free Software Foundation.
#
#  This program is distributed in the hope that it would be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#group daemons/www {
#    perm {
#        task {
#            uid = root;
#            gid = webmaster;
#        }
#        admin {
#            uid = root;
#            gid = root;
#        }
#    }
#    cpu {
#        cpu.shares = 1000;
#    }
#}
#
#group daemons/ftp {
#    perm {
#        task {
#            uid = root;
#            gid = ftpmaster;
#        }
#        admin {
#            uid = root;
#            gid = root;
#        }
#    }
#    cpu {
#        cpu.shares = 500;
#    }
#}
#
#mount {
#    cpu = /sys/fs/cgroup/cpu;
#    cpuacct = /sys/fs/cgroup/cpuacct;
#}

Odpalam uslugi i.. chodza.

Kod:

 systemctl status cgconfig.service
● cgconfig.service - Control Group configuration service
   Loaded: loaded (/lib/systemd/system/cgconfig.service; enabled; vendor preset:
   Active: active (exited) since Mon 2018-07-16 07:40:10 IST; 1h 26min ago
  Process: 387 ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf -s 1664 
 Main PID: 387 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0
   CGroup: /system.slice/cgconfig.service

Kod:

systemctl status cgred.service
● cgred.service - CGroups Rules Engine Daemon
   Loaded: loaded (/lib/systemd/system/cgred.service; enabled; vendor preset: en
   Active: active (running) since Mon 2018-07-16 07:41:43 IST; 1h 26min ago
  Process: 1455 ExecStart=/usr/sbin/cgrulesengd $OPTIONS (code=exited, status=0/
 Main PID: 1524 (cgrulesengd)
    Tasks: 1
   Memory: 4.7M
      CPU: 6.107s
   CGroup: /system.slice/cgred.service
           └─1524 /usr/sbin/cgrulesengd

Demon start:

Kod:

/usr/sbin/cgrulesengd --nodaemon --nolog &
[1] 28411

Cgroups:

Kod:

# lscgroup
cpuset:/
net_cls,net_prio:/
cpu,cpuacct:/
cpu,cpuacct:/user.slice
cpu,cpuacct:/user.slice/user-0.slice
cpu,cpuacct:/user.slice/user-0.slice/user@0.service
cpu,cpuacct:/user.slice/user-0.slice/session-c2.scope
cpu,cpuacct:/user.slice/user-1000.slice
cpu,cpuacct:/init.scope
cpu,cpuacct:/system.slice
cpu,cpuacct:/system.slice/irqbalance.service
cpu,cpuacct:/system.slice/apport.service
cpu,cpuacct:/system.slice/lightdm.service
cpu,cpuacct:/system.slice/qemu-kvm.service
cpu,cpuacct:/system.slice/polkitd.service
cpu,cpuacct:/system.slice/sys-kernel-debug.mount
cpu,cpuacct:/system.slice/run-user-1000-gvfs.mount
cpu,cpuacct:/system.slice/binfmt-support.service
cpu,cpuacct:/system.slice/systemd-random-seed.service
cpu,cpuacct:/system.slice/grub-common.service
cpu,cpuacct:/system.slice/colord.service
cpu,cpuacct:/system.slice/systemd-journal-flush.service
cpu,cpuacct:/system.slice/alsa-restore.service
cpu,cpuacct:/system.slice/systemd-timesyncd.service
cpu,cpuacct:/system.slice/systemd-user-sessions.service
cpu,cpuacct:/system.slice/kibana.service
cpu,cpuacct:/system.slice/sys-kernel-config.mount
cpu,cpuacct:/system.slice/unattended-upgrades.service
cpu,cpuacct:/system.slice/ondemand.service
cpu,cpuacct:/system.slice/dev-hugepages.mount
cpu,cpuacct:/system.slice/lxcfs.service
cpu,cpuacct:/system.slice/snapd.service
cpu,cpuacct:/system.slice/lxc-net.service
cpu,cpuacct:/system.slice/hddtemp.service
cpu,cpuacct:/system.slice/upower.service
cpu,cpuacct:/system.slice/sys-fs-fuse-connections.mount
cpu,cpuacct:/system.slice/resolvconf.service
cpu,cpuacct:/system.slice/NetworkManager.service
cpu,cpuacct:/system.slice/dbus.service
cpu,cpuacct:/system.slice/libvirt-bin.service
cpu,cpuacct:/system.slice/var-lib-lxcfs.mount
cpu,cpuacct:/system.slice/accounts-daemon.service
cpu,cpuacct:/system.slice/postfix.service
cpu,cpuacct:/system.slice/systemd-modules-load.service
cpu,cpuacct:/system.slice/dev-mqueue.mount
cpu,cpuacct:/system.slice/run-user-1000.mount
cpu,cpuacct:/system.slice/udisks2.service
cpu,cpuacct:/system.slice/whoopsie.service
cpu,cpuacct:/system.slice/suricata.service
cpu,cpuacct:/system.slice/autopoweroff.service
cpu,cpuacct:/system.slice/systemd-tmpfiles-setup.service
cpu,cpuacct:/system.slice/media-robin-intermediate.mount
cpu,cpuacct:/system.slice/avahi-daemon.service
cpu,cpuacct:/system.slice/libvirt-guests.service
cpu,cpuacct:/system.slice/cgroupfs-mount.service
cpu,cpuacct:/system.slice/cgred.service
cpu,cpuacct:/system.slice/systemd-remount-fs.service
cpu,cpuacct:/system.slice/system-getty.slice
cpu,cpuacct:/system.slice/cgconfig.service
cpu,cpuacct:/system.slice/wpa_supplicant.service
cpu,cpuacct:/system.slice/systemd-update-utmp.service
cpu,cpuacct:/system.slice/smartd.service
cpu,cpuacct:/system.slice/keyboard-setup.service
cpu,cpuacct:/system.slice/proc-sys-fs-binfmt_misc.mount
cpu,cpuacct:/system.slice/apparmor.service
cpu,cpuacct:/system.slice/NetworkManager-wait-online.service
cpu,cpuacct:/system.slice/systemd-logind.service
cpu,cpuacct:/system.slice/rtkit-daemon.service
cpu,cpuacct:/system.slice/rc-local.service
cpu,cpuacct:/system.slice/run-cgmanager-fs.mount
cpu,cpuacct:/system.slice/cups.service
cpu,cpuacct:/system.slice/cron.service
cpu,cpuacct:/system.slice/speech-dispatcher.service
cpu,cpuacct:/system.slice/systemd-udevd.service
cpu,cpuacct:/system.slice/acpid.service
cpu,cpuacct:/system.slice/ebtables.service
cpu,cpuacct:/system.slice/rsyslog.service
cpu,cpuacct:/system.slice/lm-sensors.service
cpu,cpuacct:/system.slice/networking.service
cpu,cpuacct:/system.slice/systemd-tmpfiles-setup-dev.service
cpu,cpuacct:/system.slice/atd.service
cpu,cpuacct:/system.slice/systemd-journald.service
cpu,cpuacct:/system.slice/console-setup.service
cpu,cpuacct:/system.slice/cgmanager.service
cpu,cpuacct:/system.slice/kmod-static-nodes.service
cpu,cpuacct:/system.slice/ufw.service
cpu,cpuacct:/system.slice/systemd-sysctl.service
cpu,cpuacct:/system.slice/-.mount
cpu,cpuacct:/system.slice/lxc.service
cpu,cpuacct:/system.slice/setvtrgb.service
cpu,cpuacct:/system.slice/cups-browsed.service
cpu,cpuacct:/system.slice/systemd-udev-trigger.service
devices:/
devices:/user.slice
devices:/user.slice/user-0.slice
devices:/user.slice/user-0.slice/user@0.service
devices:/user.slice/user-0.slice/session-c2.scope
devices:/user.slice/user-1000.slice
devices:/init.scope
devices:/system.slice
devices:/system.slice/irqbalance.service
devices:/system.slice/apport.service
devices:/system.slice/lightdm.service
devices:/system.slice/qemu-kvm.service
devices:/system.slice/polkitd.service
devices:/system.slice/sys-kernel-debug.mount
devices:/system.slice/run-user-1000-gvfs.mount
devices:/system.slice/binfmt-support.service
devices:/system.slice/systemd-random-seed.service
devices:/system.slice/grub-common.service
devices:/system.slice/colord.service
devices:/system.slice/systemd-journal-flush.service
devices:/system.slice/alsa-restore.service
devices:/system.slice/systemd-timesyncd.service
devices:/system.slice/systemd-user-sessions.service
devices:/system.slice/kibana.service
devices:/system.slice/sys-kernel-config.mount
devices:/system.slice/unattended-upgrades.service
devices:/system.slice/ondemand.service
devices:/system.slice/dev-hugepages.mount
devices:/system.slice/lxcfs.service
devices:/system.slice/snapd.service
devices:/system.slice/lxc-net.service
devices:/system.slice/hddtemp.service
devices:/system.slice/upower.service
devices:/system.slice/sys-fs-fuse-connections.mount
devices:/system.slice/resolvconf.service
devices:/system.slice/NetworkManager.service
devices:/system.slice/dbus.service
devices:/system.slice/libvirt-bin.service
devices:/system.slice/var-lib-lxcfs.mount
devices:/system.slice/accounts-daemon.service
devices:/system.slice/postfix.service
devices:/system.slice/systemd-modules-load.service
devices:/system.slice/dev-mqueue.mount
devices:/system.slice/run-user-1000.mount
devices:/system.slice/udisks2.service
devices:/system.slice/whoopsie.service
devices:/system.slice/suricata.service
devices:/system.slice/autopoweroff.service
devices:/system.slice/systemd-tmpfiles-setup.service
devices:/system.slice/media-robin-intermediate.mount
devices:/system.slice/avahi-daemon.service
devices:/system.slice/libvirt-guests.service
devices:/system.slice/cgroupfs-mount.service
devices:/system.slice/cgred.service
devices:/system.slice/systemd-remount-fs.service
devices:/system.slice/system-getty.slice
devices:/system.slice/cgconfig.service
devices:/system.slice/wpa_supplicant.service
devices:/system.slice/systemd-update-utmp.service
devices:/system.slice/smartd.service
devices:/system.slice/keyboard-setup.service
devices:/system.slice/proc-sys-fs-binfmt_misc.mount
devices:/system.slice/apparmor.service
devices:/system.slice/NetworkManager-wait-online.service
devices:/system.slice/systemd-logind.service
devices:/system.slice/rtkit-daemon.service
devices:/system.slice/rc-local.service
devices:/system.slice/run-cgmanager-fs.mount
devices:/system.slice/cups.service
devices:/system.slice/cron.service
devices:/system.slice/speech-dispatcher.service
devices:/system.slice/systemd-udevd.service
devices:/system.slice/acpid.service
devices:/system.slice/ebtables.service
devices:/system.slice/rsyslog.service
devices:/system.slice/lm-sensors.service
devices:/system.slice/networking.service
devices:/system.slice/systemd-tmpfiles-setup-dev.service
devices:/system.slice/atd.service
devices:/system.slice/systemd-journald.service
devices:/system.slice/console-setup.service
devices:/system.slice/cgmanager.service
devices:/system.slice/kmod-static-nodes.service
devices:/system.slice/ufw.service
devices:/system.slice/systemd-sysctl.service
devices:/system.slice/-.mount
devices:/system.slice/lxc.service
devices:/system.slice/setvtrgb.service
devices:/system.slice/cups-browsed.service
devices:/system.slice/systemd-udev-trigger.service
perf_event:/
freezer:/
freezer:/user
freezer:/user/robin
freezer:/user/robin/0
freezer:/user/root
freezer:/user/root/0
hugetlb:/
pids:/
pids:/user.slice
pids:/user.slice/user-0.slice
pids:/user.slice/user-0.slice/user@0.service
pids:/user.slice/user-0.slice/session-c2.scope
pids:/user.slice/user-1000.slice
pids:/init.scope
pids:/system.slice
pids:/system.slice/irqbalance.service
pids:/system.slice/apport.service
pids:/system.slice/lightdm.service
pids:/system.slice/qemu-kvm.service
pids:/system.slice/polkitd.service
pids:/system.slice/sys-kernel-debug.mount
pids:/system.slice/run-user-1000-gvfs.mount
pids:/system.slice/binfmt-support.service
pids:/system.slice/systemd-random-seed.service
pids:/system.slice/grub-common.service
pids:/system.slice/colord.service
pids:/system.slice/systemd-journal-flush.service
pids:/system.slice/alsa-restore.service
pids:/system.slice/systemd-timesyncd.service
pids:/system.slice/systemd-user-sessions.service
pids:/system.slice/kibana.service
pids:/system.slice/sys-kernel-config.mount
pids:/system.slice/unattended-upgrades.service
pids:/system.slice/ondemand.service
pids:/system.slice/dev-hugepages.mount
pids:/system.slice/lxcfs.service
pids:/system.slice/snapd.service
pids:/system.slice/lxc-net.service
pids:/system.slice/hddtemp.service
pids:/system.slice/upower.service
pids:/system.slice/sys-fs-fuse-connections.mount
pids:/system.slice/resolvconf.service
pids:/system.slice/NetworkManager.service
pids:/system.slice/dbus.service
pids:/system.slice/libvirt-bin.service
pids:/system.slice/var-lib-lxcfs.mount
pids:/system.slice/accounts-daemon.service
pids:/system.slice/postfix.service
pids:/system.slice/systemd-modules-load.service
pids:/system.slice/dev-mqueue.mount
pids:/system.slice/run-user-1000.mount
pids:/system.slice/udisks2.service
pids:/system.slice/whoopsie.service
pids:/system.slice/suricata.service
pids:/system.slice/autopoweroff.service
pids:/system.slice/systemd-tmpfiles-setup.service
pids:/system.slice/media-robin-intermediate.mount
pids:/system.slice/avahi-daemon.service
pids:/system.slice/libvirt-guests.service
pids:/system.slice/cgroupfs-mount.service
pids:/system.slice/cgred.service
pids:/system.slice/systemd-remount-fs.service
pids:/system.slice/system-getty.slice
pids:/system.slice/cgconfig.service
pids:/system.slice/wpa_supplicant.service
pids:/system.slice/systemd-update-utmp.service
pids:/system.slice/smartd.service
pids:/system.slice/keyboard-setup.service
pids:/system.slice/proc-sys-fs-binfmt_misc.mount
pids:/system.slice/apparmor.service
pids:/system.slice/NetworkManager-wait-online.service
pids:/system.slice/systemd-logind.service
pids:/system.slice/rtkit-daemon.service
pids:/system.slice/rc-local.service
pids:/system.slice/run-cgmanager-fs.mount
pids:/system.slice/cups.service
pids:/system.slice/cron.service
pids:/system.slice/speech-dispatcher.service
pids:/system.slice/systemd-udevd.service
pids:/system.slice/acpid.service
pids:/system.slice/ebtables.service
pids:/system.slice/rsyslog.service
pids:/system.slice/lm-sensors.service
pids:/system.slice/networking.service
pids:/system.slice/systemd-tmpfiles-setup-dev.service
pids:/system.slice/atd.service
pids:/system.slice/systemd-journald.service
pids:/system.slice/console-setup.service
pids:/system.slice/cgmanager.service
pids:/system.slice/kmod-static-nodes.service
pids:/system.slice/ufw.service
pids:/system.slice/systemd-sysctl.service
pids:/system.slice/-.mount
pids:/system.slice/lxc.service
pids:/system.slice/setvtrgb.service
pids:/system.slice/cups-browsed.service
pids:/system.slice/systemd-udev-trigger.service
memory:/
memory:/user
memory:/user/robin
memory:/user/robin/0
memory:/user/root
memory:/user/root/0
memory:/user.slice
memory:/user.slice/user-0.slice
memory:/user.slice/user-0.slice/user@0.service
memory:/user.slice/user-0.slice/session-c2.scope
memory:/user.slice/user-1000.slice
memory:/init.scope
memory:/system.slice
memory:/system.slice/irqbalance.service
memory:/system.slice/apport.service
memory:/system.slice/lightdm.service
memory:/system.slice/qemu-kvm.service
memory:/system.slice/polkitd.service
memory:/system.slice/sys-kernel-debug.mount
memory:/system.slice/run-user-1000-gvfs.mount
memory:/system.slice/binfmt-support.service
memory:/system.slice/systemd-random-seed.service
memory:/system.slice/grub-common.service
memory:/system.slice/colord.service
memory:/system.slice/systemd-journal-flush.service
memory:/system.slice/alsa-restore.service
memory:/system.slice/systemd-timesyncd.service
memory:/system.slice/systemd-user-sessions.service
memory:/system.slice/kibana.service
memory:/system.slice/sys-kernel-config.mount
memory:/system.slice/unattended-upgrades.service
memory:/system.slice/ondemand.service
memory:/system.slice/dev-hugepages.mount
memory:/system.slice/lxcfs.service
memory:/system.slice/snapd.service
memory:/system.slice/lxc-net.service
memory:/system.slice/hddtemp.service
memory:/system.slice/upower.service
memory:/system.slice/sys-fs-fuse-connections.mount
memory:/system.slice/resolvconf.service
memory:/system.slice/NetworkManager.service
memory:/system.slice/dbus.service
memory:/system.slice/libvirt-bin.service
memory:/system.slice/var-lib-lxcfs.mount
memory:/system.slice/accounts-daemon.service
memory:/system.slice/postfix.service
memory:/system.slice/systemd-modules-load.service
memory:/system.slice/dev-mqueue.mount
memory:/system.slice/run-user-1000.mount
memory:/system.slice/udisks2.service
memory:/system.slice/whoopsie.service
memory:/system.slice/suricata.service
memory:/system.slice/autopoweroff.service
memory:/system.slice/systemd-tmpfiles-setup.service
memory:/system.slice/media-robin-intermediate.mount
memory:/system.slice/avahi-daemon.service
memory:/system.slice/libvirt-guests.service
memory:/system.slice/cgroupfs-mount.service
memory:/system.slice/cgred.service
memory:/system.slice/systemd-remount-fs.service
memory:/system.slice/system-getty.slice
memory:/system.slice/cgconfig.service
memory:/system.slice/wpa_supplicant.service
memory:/system.slice/systemd-update-utmp.service
memory:/system.slice/smartd.service
memory:/system.slice/keyboard-setup.service
memory:/system.slice/proc-sys-fs-binfmt_misc.mount
memory:/system.slice/apparmor.service
memory:/system.slice/NetworkManager-wait-online.service
memory:/system.slice/systemd-logind.service
memory:/system.slice/rtkit-daemon.service
memory:/system.slice/rc-local.service
memory:/system.slice/run-cgmanager-fs.mount
memory:/system.slice/cups.service
memory:/system.slice/cron.service
memory:/system.slice/speech-dispatcher.service
memory:/system.slice/systemd-udevd.service
memory:/system.slice/acpid.service
memory:/system.slice/ebtables.service
memory:/system.slice/rsyslog.service
memory:/system.slice/lm-sensors.service
memory:/system.slice/networking.service
memory:/system.slice/systemd-tmpfiles-setup-dev.service
memory:/system.slice/atd.service
memory:/system.slice/systemd-journald.service
memory:/system.slice/console-setup.service
memory:/system.slice/cgmanager.service
memory:/system.slice/kmod-static-nodes.service
memory:/system.slice/ufw.service
memory:/system.slice/systemd-sysctl.service
memory:/system.slice/-.mount
memory:/system.slice/lxc.service
memory:/system.slice/setvtrgb.service
memory:/system.slice/cups-browsed.service
memory:/system.slice/systemd-udev-trigger.service
blkio:/
blkio:/user.slice
blkio:/user.slice/user-0.slice
blkio:/user.slice/user-0.slice/user@0.service
blkio:/user.slice/user-0.slice/session-c2.scope
blkio:/user.slice/user-1000.slice
blkio:/init.scope
blkio:/system.slice
blkio:/system.slice/irqbalance.service
blkio:/system.slice/apport.service
blkio:/system.slice/lightdm.service
blkio:/system.slice/qemu-kvm.service
blkio:/system.slice/polkitd.service
blkio:/system.slice/sys-kernel-debug.mount
blkio:/system.slice/run-user-1000-gvfs.mount
blkio:/system.slice/binfmt-support.service
blkio:/system.slice/systemd-random-seed.service
blkio:/system.slice/grub-common.service
blkio:/system.slice/colord.service
blkio:/system.slice/systemd-journal-flush.service
blkio:/system.slice/alsa-restore.service
blkio:/system.slice/systemd-timesyncd.service
blkio:/system.slice/systemd-user-sessions.service
blkio:/system.slice/kibana.service
blkio:/system.slice/sys-kernel-config.mount
blkio:/system.slice/unattended-upgrades.service
blkio:/system.slice/ondemand.service
blkio:/system.slice/dev-hugepages.mount
blkio:/system.slice/lxcfs.service
blkio:/system.slice/snapd.service
blkio:/system.slice/lxc-net.service
blkio:/system.slice/hddtemp.service
blkio:/system.slice/upower.service
blkio:/system.slice/sys-fs-fuse-connections.mount
blkio:/system.slice/resolvconf.service
blkio:/system.slice/NetworkManager.service
blkio:/system.slice/dbus.service
blkio:/system.slice/libvirt-bin.service
blkio:/system.slice/var-lib-lxcfs.mount
blkio:/system.slice/accounts-daemon.service
blkio:/system.slice/postfix.service
blkio:/system.slice/systemd-modules-load.service
blkio:/system.slice/dev-mqueue.mount
blkio:/system.slice/run-user-1000.mount
blkio:/system.slice/udisks2.service
blkio:/system.slice/whoopsie.service
blkio:/system.slice/suricata.service
blkio:/system.slice/autopoweroff.service
blkio:/system.slice/systemd-tmpfiles-setup.service
blkio:/system.slice/media-robin-intermediate.mount
blkio:/system.slice/avahi-daemon.service
blkio:/system.slice/libvirt-guests.service
blkio:/system.slice/cgroupfs-mount.service
blkio:/system.slice/cgred.service
blkio:/system.slice/systemd-remount-fs.service
blkio:/system.slice/system-getty.slice
blkio:/system.slice/cgconfig.service
blkio:/system.slice/wpa_supplicant.service
blkio:/system.slice/systemd-update-utmp.service
blkio:/system.slice/smartd.service
blkio:/system.slice/keyboard-setup.service
blkio:/system.slice/proc-sys-fs-binfmt_misc.mount
blkio:/system.slice/apparmor.service
blkio:/system.slice/NetworkManager-wait-online.service
blkio:/system.slice/systemd-logind.service
blkio:/system.slice/rtkit-daemon.service
blkio:/system.slice/rc-local.service
blkio:/system.slice/run-cgmanager-fs.mount
blkio:/system.slice/cups.service
blkio:/system.slice/cron.service
blkio:/system.slice/speech-dispatcher.service
blkio:/system.slice/systemd-udevd.service
blkio:/system.slice/acpid.service
blkio:/system.slice/ebtables.service
blkio:/system.slice/rsyslog.service
blkio:/system.slice/lm-sensors.service
blkio:/system.slice/networking.service
blkio:/system.slice/systemd-tmpfiles-setup-dev.service
blkio:/system.slice/atd.service
blkio:/system.slice/systemd-journald.service
blkio:/system.slice/console-setup.service
blkio:/system.slice/cgmanager.service
blkio:/system.slice/kmod-static-nodes.service
blkio:/system.slice/ufw.service
blkio:/system.slice/systemd-sysctl.service
blkio:/system.slice/-.mount
blkio:/system.slice/lxc.service
blkio:/system.slice/setvtrgb.service
blkio:/system.slice/cups-browsed.service
blkio:/system.slice/systemd-udev-trigger.service

Brakuje podsystemu net_cls:

Kod:

modprobe net_cls
modprobe: FATAL: Module net_cls not found in directory /lib/modules/4.15.0-24-generic

Szukam modulu:

Kod:

find /lib/modules/`uname -r` -iname "*cgroup*"
/lib/modules/4.15.0-24-generic/kernel/net/sched/cls_cgroup.ko
/lib/modules/4.15.0-24-generic/kernel/net/netfilter/xt_cgroup.ko

Laduje:

Kod:

sudo modprobe cls_cgroup

Wynik:

Kod:

grep CGROUP /boot/config-`uname -r`
CONFIG_CGROUPS=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NET_CLS_CGROUP=m
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y

Nie potrafilem ustawic kolejnosci cgconfig przed cgrulesngd !

Moim glownym celem bylo zeby persistent cgrulesngd daemon przypisywal automatycznie wszystkie procesy do kolejnych
cgroups.
Jak zobaczyc liste/zestawienie wszystkich cgroups z siedzacymi w nich procesami?

Ostatnio edytowany przez Novi-cjusz (2018-07-16 10:46:03)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#2 2018-07-16 10:40:18

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Prawdopodobnie masz już cgroup ustawiony przez systemd.

Poza tym w /etc/cgrules.conf nie masz literalnie żandych reguł, tylko i wyłącznie komentarze.
W takiej sytuacji demon cgrulesngd nie ma w ogóle nic do roboty.

Musisz założyć hierarchię katalogów dla grup w cgroups, a potem skonfigurować cgrules.conf, żeby demon pakował procesy do poszczególnych grup.

Trzeba to skonfigurować, samo się nie zrobi.


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#3 2018-07-16 10:42:58

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Tego jeszcze nie doczytalem.

Utworzylem grupe "net_cls" ktora nazwalem "bloc"

Kod:

modprobe cls_cgroup
              mkdir /sys/fs/cgroup/net_cls
              mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls
              mkdir /sys/fs/cgroup/net_cls/block

Wystartowalem z plikiem /etc/cgconfig.conf:

Kod:

group block {
         net_cls {net_cls.classid="0";
    }

Nie mam pomyslu jak ten plik konfiguracyjny dokonczyc ?

Plik  /etc/cgrules.conf tak zrobilem:

Kod:

# /etc/cgrules.conf
#The format of this file is described in cgrules.conf(5)
#manual page.
#
# Example:
#<user>         <controllers>   <destination>
#@student       cpu,memory      usergroup/student/
#peter          cpu             test1/
#%              memory          test2/
'*'             net_cls         block
# End of file

Ostatnio edytowany przez Novi-cjusz (2018-07-17 14:09:45)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#4 2018-07-28 15:54:44

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Zrobilem kawal porzadnej roboty i nadal robie bledy (;-(
Przeczytalem:
https://tiny.pl/g6ljb
https://tiny.pl/g6ljz
https://tiny.pl/g6lph
https://tiny.pl/g6lpx
https://tiny.pl/g6llv
https://tiny.pl/g6lpt
https://tiny.pl/g6lpm
+ wiele innych.
Wydaje sie, ze nie powinno byc zadnego problemu, ale niestety.
Wykonalem kilka roznych konfiguracji dla plikow:
- cgconfig.conf
- cgrules.conf
Wiem, ze miedzy nimi istnieje scisly zwiazek a cgrules.conf wynika z cgconfig.conf.
Nie podaje tych konfiguracji, zeby nie zasmiecac, ich zastosowanie powodowalo zablokowanie uslug:
- cgconfig.service
- cgred.service
Niestety:
- Konfiguracja grup w hierarchii - czyli plik "cgconfig.conf"
- Konfiguracja reguł przydzielania procesów do odpowiednich grup - czyli plik "cgrules.conf"
w odniesieniu do subsystemu "net_cls" !!! co ma pozniej byc zastosowane w iptables,
nie jest dla mnie calkowicie zrozumiala.
Stad prosba do bardziej zaawansowanych o:
- prezentacje poprawnych obydwu ww plikow
- kilka slow interpretacji w "ludzkim jezyku"
Pozdro.

Ostatnio edytowany przez Novi-cjusz (2018-07-28 18:03:48)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#5 2018-07-28 17:14:42

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

A ja tam dalej używam własnego skrypta cgstart (zgodnego z cgroup v1), do tego demona cgrulesengd, i wsio bryka jak powinno.
Bryka nawet na stabilnym Debianie odpalanym przez SystemD, co mnie nawet trochę zdziwiło.

Kod:

root ~> cat /proc/version
Linux version 4.9.0-7-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.110-1 (2018-07-05)

cat /proc/`pidof mysqld`/cgroup
10:cpuset:/
9:pids:/system.slice/daemontools.service
8:blkio:/serwer/mysqld
7:memory:/serwer/mysqld
6:perf_event:/
5:net_cls,net_prio:/serwer/mysqld
4:devices:/system.slice/daemontools.service
3:cpu,cpuacct:/serwer/mysqld
2:freezer:/
1:name=systemd:/system.slice/daemontools.service

Wytłuszczone klucze dodałem osobiście za pośrednictwem  skryptu cgstart.

SOA#1

Pozdro
;-)

Ostatnio edytowany przez Jacekalex (2018-07-28 17:19:35)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#6 2018-07-28 19:16:45

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Jak ja chciałem ustawić wsio w cgconfig, to przez pół dnia miałem same błędy.

W końcu się wkurzyłem, zostawiłem czysty cgconfig.conf (wtedy cgconfig i cgred wstają  prawidłowo), zrobiłem sobie skrypta, żeby limitował firefoxa, zadziałało, to kopiowałem i zmieniałem nazwy programów, aż powstał cgstart, i dalej rośnie. :D

Pozostało tylko w cgrules.conf ustawić, żeby pakował programy, gdzie trzeba (zabawa aliansami i skryptami przy większej liczbie programów nie jest zbyt wygodna), i gotowe.

W skrypcie każda zmiana i poprawka trwa maksimum 5 minut, na pieprzenie z konfiguracją cgconfig mi szkoda czasu i nerwów.

Ja mam tak, i cały cgroup śmiga, inna sprawa, że cgconfig nie potrafił czytać wląsnego pliku konfiguracyjnego, cgexec i cgcreate nie używam w ogóle, z całego libcgroup używam tylko demona cgred, czyli dokładniej /usr/sbin/cgrulesengd, żeby automatycznie wrzucał programy do odpowiednich grup.

Hierarchię grup tworzy u mnie cgstart (zawsze działa :D ), jedyny konfig, w którym ustwiałem conieco, to /etc/cgroup/cgrules.conf

Szukam dalej. (:D
Pozdro.

Ostatnio edytowany przez Novi-cjusz (2018-07-28 19:19:46)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#7 2018-07-28 19:56:03

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Przecież już raz to miałeś zrobione i działało od A do Z.
Włącznie ze skryptami startowymi do SystemD.

Może na przysłość zacznij stosować backup (unikalnej konfiguracji i skryptów),
zamiast co jakiś czas wracać ciągle z tymi samymi problemami?

Ostatnio edytowany przez Jacekalex (2018-07-28 19:57:03)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#8 2018-07-28 20:12:30

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Wiem, ze zawalilem nie robiac backapu.
Mea culpa.
Teraz zrobie na zewnetrznym dysku, zeby nie wracac do tematu, a miec dane pod reka.
Mniej wiecej rok temu mialem przepiecie w sieci energetycznej, stracilem zasilacz do kompa i dane na dysku.
Teraz staram sie to zlozyc z roznych czesci ale mi kiepsko idzie.
Mam najwiekszy problem z tym plikiem " cgconfig.conf "
Wyczytalem, ze sklada sie z 2 zasadniczych skladowych:
- group
- mount
Gdzie indziej Morfik pisal zeby tylko pisac group.
Ty sie wypowiadales zeby zostawiac pusty, bo demon go wypelni.
Zrozumialem to tak, ze zalezy jak chcemy zastosowac (2 opcje):
- skrypt startowy cgstart + demon cgrulesngd + cgrules.conf.
- Systemd + skrypty startowe

Ostatnio edytowany przez Novi-cjusz (2018-07-28 20:33:25)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#9 2018-07-28 20:27:04

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Co CI przypomina, Co Ci przypomina, widok znajomy ten:

Kod:

###root ~> cat /Debian/etc/systemd/system/cgstart.service
[Unit]
DefaultDependencies=no
Description="CGSTART - Zakładam strukturę grup do cgroup ;)"
Before=cgred.service

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/cgstart
TimeoutSec=0
RemainAfterExit=yes

[Install]
RequiredBy=local-fs.target

Kod:

### root ~> cat /Debian/etc/systemd/system/cgred.service
[Unit]
DefaultDependencies=no
Description="CGRULESENGD - zaczynam robotę ;)"
Wants=cgstart.service
After=cgstart.service

[Service]
Type=oneshot
ExecStart=/usr/sbin/cgrulesengd --nodaemon --nolog
ExecStop=kill $(pgrep cgrulesengd)
TimeoutSec=0
RemainAfterExit=yes

[Install]
RequiredBy=local-fs.target

Kod:

### root ~>  grep users  /etc/cgroup/cgrules.conf  
*:Xorg                                     cpu,memory,blkio,pids            users/xorg/
*:X                                        cpu,memory,blkio,pids            users/xorg/
*:xinit                                    cpu,memory,blkio,pids            users/xorg/
*:firefox                                  cpu,memory,net_cls,blkio,pids    users/firefox/
*:plugin-container                         cpu,memory,net_cls,blkio,pids    users/firefox/
*:opera                                    cpu,memory,net_cls,blkio,pids    users/opera/
*:opera-developer                          cpu,memory,net_cls,blkio,pids    users/opera/
*:webperl                                  cpu,memory,net_cls,blkio,pids    users/opera/
*:miniweb                                  cpu,memory,net_cls,blkio,pids    users/opera/
*:qtweb                                    cpu,memory,net_cls,blkio,pids    users/opera/
*:gpg-agent                                cpu,memory,net_cls,blkio    users/gpg/
*:gpg2                                     cpu,memory,net_cls,blkio    users/gpg/
*:gpg                                      cpu,memory,net_cls,blkio    users/gpg/
*:gpa                                      cpu,memory,net_cls,blkio    users/gpg/
*:choqok                                   cpu,memory,net_cls,blkio,pids    users/choqok/
*:quiterss                                 cpu,memory,net_cls,blkio,pids    users/quiterss/
*:akregator                                cpu,memory,blkio,net_cls,pids    users/akregator/
*:rssguard                                 cpu,memory,blkio,net_cls,pids    users/akregator/
*:audacious                                cpu,memory,blkio,net_cls,pids    users/audacious/
*:gdesklets                                net_cls               users/netout/
*:gweather-applet-2                        net_cls               users/netout/
*:gweather-applet-2                        net_cls               users/netout/
*:qbittorrent                              cpu,memory,net_cls    users/qbittorrent/
*:rtmpdump                                 cpu,memory,net_cls   users/rtmpdump/
*:cclive                                   cpu,memory,net_cls   users/cclive/
*:clive                                    cpu,memory,net_cls   users/clive/
*:linphone                                 cpu,memory,blkio,net_cls,pids      users/linphone/
*:pidgin                                   cpu,memory,blkio,net_cls,pids      users/pidgin/
*:psi                                      cpu,memory,blkio,net_cls           users/psi/
*:kopete                                   cpu,memory,blkio,net_cls,pids      users/kopete/
*:kadu                                     cpu,memory,blkio,net_cls,pids      users/kadu/
*:konversation                             cpu,memory,net_cls,pids     users/konversation/
*:kdeinit4                                 cpu,memory,net_cls,pids     users/kde/
*:startkde                                 cpu,memory,net_cls,pids     users/kde/
*:krunner                                  cpu,memory,net_cls,pids     users/kde/
*:skartkde                                 cpu,memory,blkio,pids       users/kde/
*:startplasmacompositor                    cpu,memory,blkio,pids       users/kde/   
*:akonadictl                               cpu,memory,blkio,pids       users/kde/   
*:aria2c                                   cpu,memory,net_cls,pids    users/wget/
*:aria                                     cpu,memory,net_cls,pids    users/wget/
*:liferea                                  cpu,memory,net_cls,pids    users/liferea/
*:vlc                                      cpu,memory,net_cls,pids    users/vlc/
*:mplayer                                  cpu,memory,net_cls,pids    users/mplayer/
*:smplayer                                 cpu,memory,net_cls,pids    users/mplayer/
*:smtube                                  cpu,memory,net_cls,pids    users/mplayer/
*:mpv                                      cpu,memory,net_cls,pids    users/mplayer/
*:minitube                                 cpu,memory,net_cls,pids    users/minitube/
*:chrome                                   cpu,memory,blkio,net_cls,pids    users/chrome/
*:google-chrome-beta                       cpu,memory,blkio,net_cls,pids    users/chrome/
*:google-chrome                            cpu,memory,blkio,net_cls,pids    users/chrome/
*:opera                                    cpu,memory,net_cls,pids    users/opera/
*:totem                                    cpu,memory,net_cls,pids    users/totem/
*:mate-system-monitor                      cpu,memory                 users/sysmonitor/
*:kaffeine                                 cpu,memory,net_cls,pids    users/kaffeine/
*:thunderbird-bin                          cpu,memory,net_cls,blkio,pids    users/thunderbird/
*:thunderbird                              cpu,memory,net_cls,blkio,pids    users/thunderbird/
*:gajim                                    cpu,memory,net_cls,pids    users/gajim/
*:choqok                                   cpu,memory,net_cls,pids     users/choqok/
*:fetchmail                              cpu,memory,net_cls,blkio,pids    users/fetchmail/
*:mysql                                    net_cls              users/netout/
*:tracepath                                net_cls              users/netout/
*:tracepath6                               net_cls              users/netout/
*:traceroute-nanog                         net_cls              users/netout/
*:nc                                       net_cls              users/netout/
*:openvpn                                  net_cls              users/netout/
*:imapsync                                 net_cls              users/netout/
*:ssh                                      net_cls              users/netout/
*:ssh-copy-id                              net_cls              users/netout/
*:rsync                                    net_cls              users/netout/
*:freshclam                                net_cls              users/netout/
*:layman                                   net_cls              users/netout/
*:tracepath                                net_cls              users/netout/
*:whois                                    net_cls              users/netout/
*:traceroute                               net_cls              users/netout/
*:wp                                       net_cls              users/netout/
*:lft                                      net_cls              users/netout/
*:nc                                       net_cls              users/netout/
*:lynx                                     net_cls              users/netout/
*:ncsl                                     net_cls              users/netout/
*:openssl                                  net_cls              users/netout/
*:youtube-dl                               net_cls              users/netout/
*:mutt                                     net_cls              users/netout/
*:gpg                                      net_cls              users/netout/
*:nmap                                     net_cls              users/netout/
*:swaks                                    net_cls              users/netout/
*:pilnujdns                                net_cls              users/netout/
*:host                                     net_cls              users/netout/
*:dig                                      net_cls              users/netout/
*:ntpdate                                  net_cls              users/netout/
*:speedtest                                net_cls              users/netout/
*:telnet                                   net_cls              users/netout/
*:gnutls-cli                               net_cls              users/netout/
*:git                                      net_cls              users/netout/
*:hg                                       net_cls              users/netout/
*:svn                                      net_cls              users/netout/
*:freshclam                                net_cls              users/netout/
*:sa-update                                net_cls              users/netout/
*:clamav-unofficial-sigs.sh                net_cls              users/netout/
*:sendxmpp                                 net_cls              users/netout/
*:updatedns                                net_cls              users/netout/
*:freedns                                  net_cls              users/netout/
*:bzr                                      net_cls              users/netout/
*:cvs                                      net_cls              users/netout/
*:g-cpan                                   net_cls              users/netout/
*:cpan                                     net_cls              users/netout/
*:rssperl                                  net_cls              users/netout/
*:youtube-dl                               net_cls              users/netout/
*:ytd                                      net_cls              users/netout/
*:superkaramba                             net_cls              users/netout/
*:debroot                                  net_cls              users/netout/
*:genroot                                  net_cls              users/netout/
*:links                                    net_cls              users/netout/
*:mateweather-applet                           cpu,memory,blkio,net-cls,pids    users/mate/
*:mate-doc-prepare                             cpu,memory,blkio,pids          users/mate/
*:mate-doc-tool                                cpu,memory,blkio,pids          users/mate/
*:caja                                         cpu,memory,blkio,pids          users/mate/
*:caja-connect-server                          cpu,memory,blkio,pids          users/mate/
*:caja-autorun-software                        cpu,memory,blkio,pids          users/mate/
*:caja-file-management-properties              cpu,memory,blkio,pids          users/mate/
*:mate-cpufreq-selector                        cpu,memory,blkio,pids          users/mate/
*:mate-invest-chart                            cpu,memory,blkio,pids          users/mate/
*:mate-doc-common                              cpu,memory,blkio,pids          users/mate/
*:mate-autogen                                 cpu,memory,blkio,pids          users/mate/
*:mate-default-applications-properties         cpu,memory,blkio,pids          users/mate/
*:mate-at-properties                           cpu,memory,blkio,pids          users/mate/
*:mate-appearance-properties                   cpu,memory,blkio,pids          users/mate/
*:mate-keybinding-properties                   cpu,memory,blkio,pids          users/mate/
*:mate-display-properties                      cpu,memory,blkio,pids          users/mate/
*:mate-keyboard-properties                     cpu,memory,blkio,pids          users/mate/
*:mate-mouse-properties                        cpu,memory,blkio,pids          users/mate/
*:mate-window-properties                       cpu,memory,blkio,pids          users/mate/
*:mate-network-properties                      cpu,memory,blkio,pids          users/mate/
*:mate-thumbnail-font                          cpu,memory,blkio,pids          users/mate/
*:mate-font-viewer                             cpu,memory,blkio,pids          users/mate/
*:mate-about-me                                cpu,memory,blkio,pids          users/mate/
*:mate-typing-monitor                          cpu,memory,blkio,pids          users/mate/
*:mate-control-center                          cpu,memory,blkio,pids          users/mate/
*:mate-display-properties-install-systemwide   cpu,memory,blkio,pids          users/mate/
*:mate-about                                   cpu,memory,blkio,pids          users/mate/
*:mate-gsettings-toggle                        cpu,memory,blkio,pids          users/mate/
*:mate-conf-import                             cpu,memory,blkio,pids          users/mate/
*:mate-panel-test-applets                      cpu,memory,blkio,pids          users/mate/
*:mate-desktop-item-edit                       cpu,memory,blkio,pids          users/mate/
*:mate-panel                                   cpu,memory,blkio,pids          users/mate/
*:mate-session-properties                      cpu,memory,blkio,pids          users/mate/
*:mate-session                                 cpu,memory,blkio,pids          users/mate/
*:mate-session-save                            cpu,memory,blkio,pids          users/mate/
*:mate-wm                                      cpu,memory,blkio,pids          users/mate/
*:caja-sendto                                  cpu,memory,blkio,pids          users/mate/
*:matedialog                                   cpu,memory,blkio,pids          users/mate/
*:mate-volume-control                          cpu,memory,blkio,pids          users/mate/
*:mate-system-log                              cpu,memory,blkio,pids          users/mate/
*:mate-search-tool                             cpu,memory,blkio,pids          users/mate/
*:mate-dictionary                              cpu,memory,blkio,pids          users/mate/
*:mate-screenshot                              cpu,memory,blkio,pids          users/mate/
*:mate-disk-usage-analyzer                     cpu,memory,blkio,pids          users/mate/
*:mate-panel-screenshot                        cpu,memory,blkio,pids          users/mate/
*:mate-settings-daemon                         cpu,memory,blkio,pids          users/mate/
*:mate-cpufreq-applet                          cpu,memory,blkio,pids          users/mate/
*:wnck-applet                                  cpu,memory,blkio,pids          users/mate/
*:multiload-applet-2                           cpu,memory,blkio,pids          users/mate/
*:geyes_applet2                                cpu,memory,blkio,pids          users/mate/
*:fish-applet                                  cpu,memory,blkio,pids          users/mate/
*:notification-area-applet                     cpu,memory,blkio,pids          users/mate/
*:clock-applet                                 cpu,memory,blkio,pids          users/mate/
*:drivemount_applet2                           cpu,memory,blkio,pids          users/mate/
*:trashapplet                                  cpu,memory,blkio,pids          users/mate/
*:xdt-autogen                              cpu,memory,blkio,pids      users/xfce
*:xdt-commit                               cpu,memory,blkio,pids      users/xfce
*:xdt-csource                              cpu,memory,blkio,pids      users/xfce
*:xfce4-terminal                           cpu,memory,blkio,pids      users/xfce
*:exo-preferred-applications               cpu,memory,blkio,pids      users/xfce
*:exo-csource                              cpu,memory,blkio,pids      users/xfce
*:exo-desktop-item-edit                    cpu,memory,blkio,pids      users/xfce
*:exo-open                                 cpu,memory,blkio,pids      users/xfce
*:xfce4-about                              cpu,memory,blkio,pids      users/xfce
*:thunar-settings                          cpu,memory,blkio,pids      users/xfce
*:thunar                                   cpu,memory,blkio,pids      users/xfce
*:Thunar                                   cpu,memory,blkio,pids      users/xfce
*:xfce4-appfinder                          cpu,memory,blkio,pids      users/xfce
*:xfrun4                                   cpu,memory,blkio,pids      users/xfce
*:xfce4-popup-applicationsmenu             cpu,memory,blkio,pids      users/xfce
*:xfce4-popup-directorymenu                cpu,memory,blkio,pids      users/xfce
*:xfce4-popup-windowmenu                   cpu,memory,blkio,pids      users/xfce
*:xfce4-panel                              cpu,memory,blkio,pids      users/xfce
*:startxfce4                               cpu,memory,blkio,pids      users/xfce
*:xflock4                                  cpu,memory,blkio,pids      users/xfce
*:xfce4-session                            cpu,memory,blkio,pids      users/xfce
*:xfce4-session-settings                   cpu,memory,blkio,pids      users/xfce
*:xfce4-session-logout                     cpu,memory,blkio,pids      users/xfce
*:xfce4-accessibility-settings             cpu,memory,blkio,pids      users/xfce
*:xfce4-mouse-settings                     cpu,memory,blkio,pids      users/xfce
*:xfce4-appearance-settings                cpu,memory,blkio,pids      users/xfce
*:xfce4-display-settings                   cpu,memory,blkio,pids      users/xfce
*:xfce4-keyboard-settings                  cpu,memory,blkio,pids      users/xfce
*:xfce4-mime-settings                      cpu,memory,blkio,pids      users/xfce
*:xfce4-settings-editor                    cpu,memory,blkio,pids      users/xfce
*:xfsettingsd                              cpu,memory,blkio,pids      users/xfce
*:xfce4-settings-manager                   cpu,memory,blkio,pids      users/xfce
*:xfconf-query                             cpu,memory,blkio,pids      users/xfce
*:xfdesktop-settings                       cpu,memory,blkio,pids      users/xfce
*:xfdesktop                                cpu,memory,blkio,pids      users/xfce
*:xfwm4-settings                           cpu,memory,blkio,pids      users/xfce
*:xfwm4-tweaks-settings                    cpu,memory,blkio,pids      users/xfce
*:xfwm4-workspace-settings                 cpu,memory,blkio,pids      users/xfce
*:xfwm4                                    cpu,memory,blkio,pids      users/xfce
*:filezilla                                 cpu,memory,blkio,net_cls,pids       users/firefox/
*:wget                                      cpu,memory,net_cls,pids       users/wget/
*:axel                                      cpu,memory,net_cls,pids       users/axel/
*:aria2c                                    cpu,memory,net_cls,pids       users/aria2/
*:curl                                      cpu,memory,net_cls,pids       users/curl/

i oczywiście sam skrypcio /usr/local/sbin/cgstart we własnej osobie:

Kod:

!/bin/bash

awk 'NR>1 {print $1}' /proc/cgroups | while read -r a; 
do   b="/sys/fs/cgroup/$a";   mkdir -p "$b";  
 mount -tcgroup -o"$a" "cgroup:$a" "$b" 2>/dev/null; done
 
CGDIR='/sys/fs/cgroup/'

for clone in `ls $CGDIR/*/cgroup.clone_children`;
do echo 1 >$clone; done;

####################################################################################
# xorg
mkdir -p  $CGDIR/blkio/users/xorg
echo '1' > $CGDIR/blkio/users/xorg/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/xorg/blkio.weight

mkdir -p  $CGDIR/cpu/users/xorg
echo '1' > $CGDIR/cpu/users/xorg/cgroup.clone_children
echo '800' > $CGDIR/cpu/users/xorg/cpu.shares

mkdir -p  $CGDIR/memory/users/xorg
echo '1' > $CGDIR/memory/users/xorg/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/xorg/memory.soft_limit_in_bytes
echo '128m' >   $CGDIR/memory/users/xorg/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/xorg/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/xorg/memory.oom_control 

mkdir -p  $CGDIR/cpuset/users/xorg
echo -n '1' > $CGDIR/cpuset/users/xorg/cgroup.clone_children

mkdir -p  $CGDIR/pids/users/xorg
echo '1' > $CGDIR/pids/users/xorg/cgroup.clone_children
echo '16' > $CGDIR/pids/users/xorg/pids.max

####################################################################################

# KDE

mkdir -p $CGDIR/cpu/users/kde
echo '1'> $CGDIR/cpu/users/kde/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/kde/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kde

mkdir -p $CGDIR/cpuset/users/kde


mkdir -p $CGDIR/memory/users/kde
echo '1'> $CGDIR/memory/users/kde/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/kde/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/kde/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/kde/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/users/kde/memory.kmem.tcp.limit_in_bytes
echo '0' >   $CGDIR/memory/users/kde/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/kde
echo '1' > $CGDIR/net_cls/users/kde/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/kde/net_cls.classid

mkdir -p  $CGDIR/blkio/users/kde
echo '1' > $CGDIR/blkio/users/kde/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kde/blkio.weight

mkdir -p  $CGDIR/pids/users/kde
echo '1' > $CGDIR/pids/users/kde/cgroup.clone_children
echo '400' > $CGDIR/pids/users/kde/pids.max

#################################################################################


# Mate

mkdir -p $CGDIR/cpu/users/mate
echo '1'> $CGDIR/cpu/users/mate/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/mate/cpu.shares

mkdir -p $CGDIR/cpuacct/users/mate

mkdir -p $CGDIR/cpuset/users/mate


mkdir -p $CGDIR/memory/users/mate
echo '1'> $CGDIR/memory/users/mate/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/mate/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/mate/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/mate/memory.memsw.limit_in_bytes
echo '2048m' > $CGDIR/memory/users/mate/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/mate/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/mate
echo '1' > $CGDIR/net_cls/users/mate/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/mate/net_cls.classid

mkdir -p  $CGDIR/blkio/users/mate
echo '1' > $CGDIR/blkio/users/mate/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/mate/blkio.weight

mkdir -p  $CGDIR/pids/users/mate
echo '1' > $CGDIR/pids/users/mate/cgroup.clone_children
echo '200' > $CGDIR/pids/users/mate/pids.max

################################################################################

###  XFCE4

mkdir -p $CGDIR/cpu/users/xfce
echo '1'> $CGDIR/cpu/users/xfce/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/xfce/cpu.shares

mkdir -p $CGDIR/cpuacct/users/xfce

mkdir -p $CGDIR/cpuset/users/xfce


mkdir -p $CGDIR/memory/users/xfce
echo '1'> $CGDIR/memory/users/xfce/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/xfce/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/xfce/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/xfce/memory.memsw.limit_in_bytes
echo '2048m' > $CGDIR/memory/users/xfce/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/xfce/memory.oom_control


mkdir -p $CGDIR/net_cls/users/xfce
echo '1' > $CGDIR/net_cls/users/xfce/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/xfce/net_cls.classid

mkdir -p  $CGDIR/blkio/users/xfce
echo '1' > $CGDIR/blkio/users/xfce/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/xfce/blkio.weight

mkdir -p  $CGDIR/pids/users/xfce
echo '1' > $CGDIR/pids/users/xfce/cgroup.clone_children
echo '200' > $CGDIR/pids/users/xfce/pids.max





#################################################################################

# GPG

mkdir -p $CGDIR/cpu/users/gpg
echo '1'> $CGDIR/cpu/users/gpg/cgroup.clone_children
echo '300' >   $CGDIR/cpu/users/gpg/cpu.shares

mkdir -p $CGDIR/cpuacct/users/gpg
# echo 100 > $CGDIR/cpuacct/users/tvtime/cpuacct.usage

mkdir -p $CGDIR/cpuset/users/gpg


mkdir -p $CGDIR/memory/users/gpg
echo '1'> $CGDIR/memory/users/gpg/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/gpg/memory.soft_limit_in_bytes

mkdir -p $CGDIR/net_cls/users/gpg
echo '1' > $CGDIR/net_cls/users/gpg/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/gpg/net_cls.classid


####################################################################################
# NETOUT

mkdir -p $CGDIR/net_cls/users/netout
echo '1' > $CGDIR/net_cls/users/netout/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/netout/net_cls.classid

####################################################################################
# Google-chrome

mkdir -p $CGDIR/cpu/users/chrome
echo '1'> $CGDIR/cpu/users/chrome/cgroup.clone_children
echo '600' > $CGDIR/cpu/users/chrome/cpu.shares

mkdir -p $CGDIR/cpuacct/users/chrome

mkdir -p $CGDIR/cpuset/users/chrome


mkdir -p $CGDIR/memory/users/chrome
echo '1'> $CGDIR/memory/users/chrome/cgroup.clone_children
echo '4096m' >   $CGDIR/memory/users/chrome/memory.soft_limit_in_bytes
echo '4096m' >   $CGDIR/memory/users/chrome/memory.limit_in_bytes
echo '4096m' >   $CGDIR/memory/users/chrome/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/users/chrome/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/chrome/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/chrome
echo '1' > $CGDIR/net_cls/users/chrome/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/chrome/net_cls.classid

mkdir -p  $CGDIR/blkio/users/chrome
echo '1' > $CGDIR/blkio/users/chrome/cgroup.clone_children
echo '100' > $CGDIR/blkio/users/chrome/blkio.weight


mkdir -p  $CGDIR/pids/users/chrome
echo '1' > $CGDIR/pids/users/chrome/cgroup.clone_children
echo '256' > $CGDIR/pids/users/chrome/pids.max

#################################################################################

#  Opera

mkdir -p $CGDIR/cpu/users/opera
echo '1'> $CGDIR/cpu/users/opera/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/opera/cpu.shares

mkdir -p $CGDIR/cpuacct/users/opera

mkdir -p $CGDIR/cpuset/users/opera


mkdir -p $CGDIR/memory/users/opera
echo '1'> $CGDIR/memory/users/opera/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/opera/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/opera/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/opera/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/opera/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/opera/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/opera
echo '1' > $CGDIR/net_cls/users/opera/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/opera/net_cls.classid

mkdir -p  $CGDIR/pids/users/opera
echo '1' > $CGDIR/pids/users/opera/cgroup.clone_children
echo '32' > $CGDIR/pids/users/opera/pids.max


#################################################################################

# Pidgin

mkdir -p $CGDIR/cpu/users/pidgin
echo '1'> $CGDIR/cpu/users/pidgin/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/pidgin/cpu.shares

mkdir -p $CGDIR/cpuacct/users/pidgin

mkdir -p $CGDIR/cpuset/users/pidgin


mkdir -p $CGDIR/memory/users/pidgin
echo '1'> $CGDIR/memory/users/pidgin/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/pidgin/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/pidgin/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/pidgin/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/pidgin/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/pidgin/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/pidgin
echo '1' > $CGDIR/blkio/users/pidgin/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/pidgin/blkio.weight

mkdir -p $CGDIR/net_cls/users/pidgin
echo '1' > $CGDIR/net_cls/users/pidgin/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/pidgin/net_cls.classid

mkdir -p  $CGDIR/pids/users/pidgin
echo '1' > $CGDIR/pids/users/pidgin/cgroup.clone_children
echo '16' > $CGDIR/pids/users/pidgin/pids.max

##################################################################################

# kadu

mkdir -p $CGDIR/cpu/users/kadu
echo '1'> $CGDIR/cpu/users/kadu/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/kadu/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kadu

mkdir -p $CGDIR/cpuset/users/kadu

mkdir -p $CGDIR/memory/users/kadu
echo '1'> $CGDIR/memory/users/kadu/cgroup.clone_children
echo '160m' >   $CGDIR/memory/users/kadu/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/kadu/memory.kmem.tcp.limit_in_bytes
echo '160m' >   $CGDIR/memory/users/kadu/memory.limit_in_bytes
echo '160m' >   $CGDIR/memory/users/kadu/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kadu/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/kadu
echo '1' > $CGDIR/blkio/users/kadu/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kadu/blkio.weight

mkdir -p $CGDIR/net_cls/users/kadu
echo '1' > $CGDIR/net_cls/users/kadu/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/kadu/net_cls.classid

mkdir -p  $CGDIR/pids/users/kadu
echo '1' > $CGDIR/pids/users/kadu/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kadu/pids.max

##################################################################################

#Kopete

mkdir -p $CGDIR/cpu/users/kopete
echo '1'> $CGDIR/cpu/users/kopete/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/kopete/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kopete

mkdir -p $CGDIR/cpuset/users/kopete

mkdir -p $CGDIR/memory/users/kopete
echo '1'> $CGDIR/memory/users/kopete/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/kopete/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/kopete/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/kopete/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/kopete/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kopete/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/kopete
echo '1' > $CGDIR/blkio/users/kopete/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kopete/blkio.weight

mkdir -p $CGDIR/net_cls/users/kopete
echo '1' > $CGDIR/net_cls/users/kopete/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/kopete/net_cls.classid

mkdir -p  $CGDIR/pids/users/kopete
echo '1' > $CGDIR/pids/users/kopete/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kopete/pids.max


##################################################################################

# Choqok

mkdir -p $CGDIR/cpu/users/choqok
echo '1'> $CGDIR/cpu/users/choqok/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/choqok/cpu.shares

mkdir -p $CGDIR/cpuacct/users/choqok

mkdir -p $CGDIR/cpuset/users/choqok


mkdir -p $CGDIR/memory/users/choqok
echo '1'> $CGDIR/memory/users/choqok/cgroup.clone_children
echo '384m' >   $CGDIR/memory/users/choqok/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/choqok/memory.kmem.tcp.limit_in_bytes
echo '384m' >   $CGDIR/memory/users/choqok/memory.limit_in_bytes
echo '384m' >   $CGDIR/memory/users/choqok/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/choqok/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/choqok
echo '1' > $CGDIR/blkio/users/choqok/cgroup.clone_children
echo '500' > $CGDIR/blkio/users/choqok/blkio.weight

mkdir -p $CGDIR/net_cls/users/choqok
echo '1' > $CGDIR/net_cls/users/choqok/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/choqok/net_cls.classid

mkdir -p  $CGDIR/pids/users/choqok
echo '1' > $CGDIR/pids/users/choqok/cgroup.clone_children
echo '64' > $CGDIR/pids/users/choqok/pids.max


##################################################################################
#linphone

mkdir -p $CGDIR/cpu/users/linphone
echo '1'> $CGDIR/cpu/users/linphone/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/linphone/cpu.shares

mkdir -p $CGDIR/cpuacct/users/linphone

mkdir -p $CGDIR/cpuset/users/linphone

mkdir -p $CGDIR/memory/users/linphone
echo '1'> $CGDIR/memory/users/linphone/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/linphone/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/linphone/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/linphone/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/linphone/memory.memsw.limit_in_bytes
echo '0' >   $CGDIR/memory/users/linphone/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/linphone
echo '1' > $CGDIR/blkio/users/linphone/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/linphone/blkio.weight

mkdir -p $CGDIR/net_cls/users/linphone
echo '1' > $CGDIR/net_cls/users/linphone/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/linphone/net_cls.classid

mkdir -p  $CGDIR/pids/users/linphone
echo '1' > $CGDIR/pids/users/linphone/cgroup.clone_children
echo '16' > $CGDIR/pids/users/linphone/pids.max

##################################################################################

# Vlc

mkdir -p $CGDIR/cpu/users/vlc
echo '1'> $CGDIR/cpu/users/vlc/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/vlc/cpu.shares

mkdir -p $CGDIR/cpuacct/users/vlc

mkdir -p $CGDIR/cpuset/users/vlc


mkdir -p $CGDIR/memory/users/vlc
echo '1'> $CGDIR/memory/users/vlc/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/vlc/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/vlc/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/vlc/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/vlc/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/vlc/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/vlc
echo '1' > $CGDIR/net_cls/users/vlc/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/vlc/net_cls.classid

mkdir -p  $CGDIR/pids/users/vlc
echo '1' > $CGDIR/pids/users/vlc/cgroup.clone_children
echo '16' > $CGDIR/pids/users/vlc/pids.max

####################################################################################
# Audacious

mkdir -p $CGDIR/cpu/users/audacious
echo '1'> $CGDIR/cpu/users/audacious/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/audacious/cpu.shares

mkdir -p $CGDIR/cpuacct/users/audacious

mkdir -p $CGDIR/cpuset/users/audacious


mkdir -p $CGDIR/memory/users/audacious
echo '1'> $CGDIR/memory/users/audacious/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/audacious/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/audacious/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/audacious/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/audacious/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/audacious/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/audacious
echo '1' > $CGDIR/blkio/users/audacious/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/audacious/blkio.weight

mkdir -p $CGDIR/net_cls/users/audacious
echo '1' > $CGDIR/net_cls/users/audacious/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/audacious/net_cls.classid

mkdir -p  $CGDIR/pids/users/audacious
echo '1' > $CGDIR/pids/users/audacious/cgroup.clone_children
echo '16' > $CGDIR/pids/users/audacious/pids.max


##########################################################################################
# Thunderbird

mkdir -p $CGDIR/cpu/users/thunderbird
echo '1'> $CGDIR/cpu/users/thunderbird/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/thunderbird/cpu.shares

mkdir -p $CGDIR/cpuacct/users/thunderbird

mkdir -p $CGDIR/cpuset/users/thunderbird

mkdir -p $CGDIR/memory/users/thunderbird
echo '1'> $CGDIR/memory/users/thunderbird/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/thunderbird/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/thunderbird/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/thunderbird
echo '1' > $CGDIR/net_cls/users/thunderbird/cgroup.clone_children
echo '9' > $CGDIR/net_cls/users/thunderbird/net_cls.classid

mkdir -p  $CGDIR/blkio/users/thunderbird
echo '1' > $CGDIR/blkio/users/thunderbird/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/thunderbird/blkio.weight

mkdir -p  $CGDIR/pids/users/thunderbird
echo '1' > $CGDIR/pids/users/thunderbird/cgroup.clone_children
echo '128' > $CGDIR/pids/users/thunderbird/pids.max

##################################################################################

# fetchmail

mkdir -p $CGDIR/cpu/users/fetchmail
echo '1'> $CGDIR/cpu/users/fetchmail/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/fetchmail/cpu.shares

mkdir -p $CGDIR/cpuacct/users/fetchmail

mkdir -p $CGDIR/cpuset/users/fetchmail

mkdir -p $CGDIR/memory/users/fetchmail
echo '1'> $CGDIR/memory/users/fetchmail/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/fetchmail/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/fetchmail/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/fetchmail
echo '1' > $CGDIR/net_cls/users/fetchmail/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/fetchmail/net_cls.classid

mkdir -p  $CGDIR/blkio/users/fetchmail
echo '1' > $CGDIR/blkio/users/fetchmail/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/fetchmail/blkio.weight

mkdir -p  $CGDIR/pids/users/fetchmail
echo '1' > $CGDIR/pids/users/fetchmail/cgroup.clone_children
echo '64' > $CGDIR/pids/users/fetchmail/pids.max

###################################################################################

mkdir -p $CGDIR/cpu/voip/skype
echo '1'> $CGDIR/cpu/voip/skype/cgroup.clone_children
echo '300' > $CGDIR/cpu/voip/skype/cpu.shares

mkdir -p $CGDIR/cpuacct/voip/skype

mkdir -p $CGDIR/cpuset/voip/skype


mkdir -p $CGDIR/memory/voip/skype
echo '1'> $CGDIR/memory/voip/skype/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/voip/skype/memory.soft_limit_in_bytes
echo '1024m' >   $CGDIR/memory/voip/skype/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/voip/skype/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/voip/skype/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/voip/skype/memory.oom_control 


mkdir -p $CGDIR/net_cls/voip/skype
echo '1' > $CGDIR/net_cls/voip/skype/cgroup.clone_children
echo '4' > $CGDIR/net_cls/voip/skype/net_cls.classid

mkdir -p  $CGDIR/blkio/voip/skype
echo '1' > $CGDIR/blkio/voip/skype/cgroup.clone_children
echo '100' > $CGDIR/blkio/voip/skype/blkio.weight


mkdir -p  $CGDIR/pids/voip/skype
echo '1' > $CGDIR/pids/voip/skype/cgroup.clone_children
echo '256' > $CGDIR/pids/voip/skype/pids.max
#############################################################################

# Mplayer

mkdir -p $CGDIR/cpu/users/mplayer
echo '1'> $CGDIR/cpu/users/mplayer/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/mplayer/cpu.shares

mkdir -p $CGDIR/cpuacct/users/mplayer

mkdir -p $CGDIR/cpuset/users/mplayer


mkdir -p $CGDIR/memory/users/mplayer
echo '1'> $CGDIR/memory/users/mplayer/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/mplayer/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/mplayer/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/mplayer/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/mplayer/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/mplayer/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/mplayer
echo '1' > $CGDIR/net_cls/users/mplayer/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/mplayer/net_cls.classid

mkdir -p  $CGDIR/pids/users/mplayer
echo '1' > $CGDIR/pids/users/mplayer/cgroup.clone_children
echo '16' > $CGDIR/pids/users/mplayer/pids.max

#######################################################################################
# Minitube

mkdir -p $CGDIR/cpu/users/minitube
echo '1'> $CGDIR/cpu/users/minitube/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/minitube/cpu.shares

mkdir -p $CGDIR/cpuacct/users/minitube

mkdir -p $CGDIR/cpuset/users/minitube


mkdir -p $CGDIR/memory/users/minitube
echo '1'> $CGDIR/memory/users/minitube/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/minitube/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/minitube/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/minitube/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/minitube/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/minitube/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/minitube
echo '1' > $CGDIR/net_cls/users/minitube/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/minitube/net_cls.classid

mkdir -p  $CGDIR/pids/users/minitube
echo '1' > $CGDIR/pids/users/minitube/cgroup.clone_children
echo '16' > $CGDIR/pids/users/minitube/pids.max

#######################################################################################

# Kaffeine

mkdir -p $CGDIR/cpu/users/kaffeine
echo '1'> $CGDIR/cpu/users/kaffeine/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/kaffeine/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kaffeine

mkdir -p $CGDIR/cpuset/users/kaffeine


mkdir -p $CGDIR/memory/users/kaffeine
echo '1'> $CGDIR/memory/users/kaffeine/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/kaffeine/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/kaffeine/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/kaffeine/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/kaffeine/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kaffeine/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/kaffeine
echo '1' > $CGDIR/net_cls/users/kaffeine/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/kaffeine/net_cls.classid

mkdir -p  $CGDIR/pids/users/kaffeine
echo '1' > $CGDIR/pids/users/kaffeine/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kaffeine/pids.max


##########################################################################################

# Liferea

mkdir -p $CGDIR/cpu/users/liferea
echo '1'> $CGDIR/cpu/users/liferea/cgroup.clone_children
echo '250' >   $CGDIR/cpu/users/liferea/cpu.shares

mkdir -p $CGDIR/cpuacct/users/liferea

mkdir -p $CGDIR/cpuset/users/liferea


mkdir -p $CGDIR/memory/users/liferea
echo '1'> $CGDIR/memory/users/liferea/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/liferea/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/liferea/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/liferea/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/liferea/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/liferea/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/liferea
echo '1' > $CGDIR/net_cls/users/liferea/cgroup.clone_children
echo '3' > $CGDIR/net_cls/users/liferea/net_cls.classid

mkdir -p  $CGDIR/pids/users/liferea
echo '1' > $CGDIR/pids/users/liferea/cgroup.clone_children
echo '16' > $CGDIR/pids/users/liferea/pids.max

############################################################################

# Firefox 

mkdir -p $CGDIR/cpu/users/firefox
echo 1 > $CGDIR/cpu/users/firefox/cgroup.clone_children
echo "100" > $CGDIR/cpu/users/firefox/cpu.shares

mkdir -p  $CGDIR/blkio/users/firefox
echo '1' > $CGDIR/blkio/users/firefox/cgroup.clone_children
echo '400' > $CGDIR/blkio/users/firefox/blkio.weight

mkdir -p $CGDIR/memory/users/firefox
echo '1'> $CGDIR/memory/users/firefox/cgroup.clone_children
echo '2g' >   $CGDIR/memory/users/firefox/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/firefox/memory.kmem.tcp.limit_in_bytes
echo '2g' >   $CGDIR/memory/users/firefox/memory.limit_in_bytes
echo '2g' >   $CGDIR/memory/users/firefox/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/firefox/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/firefox
echo '3' > $CGDIR/net_cls/users/firefox/net_cls.classid
echo '1' > $CGDIR/net_cls/users/firefox/cgroup.clone_children

mkdir -p  $CGDIR/pids/users/firefox
echo '1' > $CGDIR/pids/users/firefox/cgroup.clone_children
echo '256' > $CGDIR/pids/users/firefox/pids.max

###############################################################################

# Akregator

mkdir -p $CGDIR/cpu/users/akregator
echo '1'> $CGDIR/cpu/users/akregator/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/akregator/cpu.shares

mkdir -p $CGDIR/cpuacct/users/akregator
mkdir -p $CGDIR/cpuset/users/akregator


mkdir -p $CGDIR/memory/users/akregator
echo '1'> $CGDIR/memory/users/akregator/cgroup.clone_children
echo '1536m' >   $CGDIR/memory/users/akregator/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/akregator/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/akregator/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/akregator/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/akregator/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/akregator
echo '1' > $CGDIR/blkio/users/akregator/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/akregator/blkio.weight

mkdir -p $CGDIR/net_cls/users/akregator
echo '1' > $CGDIR/net_cls/users/akregator/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/akregator/net_cls.classid


mkdir -p  $CGDIR/pids/users/akregator
echo '1' > $CGDIR/pids/users/akregator/cgroup.clone_children
echo '512' > $CGDIR/pids/users/akregator/pids.max

###############################################################################

# QuiteRSS

mkdir -p $CGDIR/cpu/users/quiterss
echo '1'> $CGDIR/cpu/users/quiterss/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/quiterss/cpu.shares

mkdir -p $CGDIR/cpuacct/users/quiterss
mkdir -p $CGDIR/cpuset/users/quiterss


mkdir -p $CGDIR/memory/users/quiterss
echo '1'> $CGDIR/memory/users/quiterss/cgroup.clone_children
echo '512m' >   $CGDIR/memory/users/quiterss/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/quiterss/memory.kmem.tcp.limit_in_bytes
echo '512m' >   $CGDIR/memory/users/quiterss/memory.limit_in_bytes
echo '512m' >   $CGDIR/memory/users/quiterss/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/quiterss/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/quiterss
echo '1' > $CGDIR/blkio/users/quiterss/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/quiterss/blkio.weight

mkdir -p $CGDIR/net_cls/users/quiterss
echo '1' > $CGDIR/net_cls/users/quiterss/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/quiterss/net_cls.classid


mkdir -p  $CGDIR/pids/users/quiterss
echo '1' > $CGDIR/pids/users/quiterss/cgroup.clone_children
echo '64' > $CGDIR/pids/users/quiterss/pids.max


#####################################################################################

# Totem

mkdir -p $CGDIR/cpu/users/totem
echo '1'> $CGDIR/cpu/users/totem/cgroup.clone_children
echo "800" >   $CGDIR/cpu/users/totem/cpu.shares

mkdir -p $CGDIR/cpuacct/users/totem
mkdir -p $CGDIR/cpuset/users/totem

mkdir -p $CGDIR/memory/users/totem
echo '1'> $CGDIR/memory/users/totem/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/totem/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/totem/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/totem/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/totem/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/totem/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/totem
echo '1' > $CGDIR/net_cls/users/totem/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/totem/net_cls.classid

mkdir -p  $CGDIR/pids/users/totem
echo '1' > $CGDIR/pids/users/totem/cgroup.clone_children
echo '32' > $CGDIR/pids/users/totem/pids.max


#######################################################################################

# Wget

mkdir -p $CGDIR/cpu/users/wget
echo '1'> $CGDIR/cpu/users/wget/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/wget/cpu.shares

mkdir -p $CGDIR/cpuacct/users/wget

mkdir -p $CGDIR/cpuset/users/wget


mkdir -p $CGDIR/memory/users/wget
echo '1'> $CGDIR/memory/users/wget/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/wget/memory.soft_limit_in_bytes
echo '256m' > $CGDIR/memory/users/wget/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/wget/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/wget/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/wget/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/wget
echo '1' > $CGDIR/net_cls/users/wget/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/wget/net_cls.classid

mkdir -p  $CGDIR/pids/users/wget
echo '1' > $CGDIR/pids/users/wget/cgroup.clone_children
echo '8' > $CGDIR/pids/users/wget/pids.max

###############################################################################

# Axel

mkdir -p $CGDIR/cpu/users/axel
echo '1'> $CGDIR/cpu/users/axel/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/axel/cpu.shares

mkdir -p $CGDIR/cpuacct/users/axel
mkdir -p $CGDIR/cpuset/users/axel

mkdir -p $CGDIR/memory/users/axel
echo '1'> $CGDIR/memory/users/axel/cgroup.clone_children
echo '32m' >   $CGDIR/memory/users/axel/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/axel/memory.kmem.tcp.limit_in_bytes
echo '32m' >   $CGDIR/memory/users/axel/memory.limit_in_bytes
echo '32m' >   $CGDIR/memory/users/axel/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/axel/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/axel
echo '1' > $CGDIR/net_cls/users/axel/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/axel/net_cls.classid

mkdir -p  $CGDIR/pids/users/axel
echo '1' > $CGDIR/pids/users/axel/cgroup.clone_children
echo '8' > $CGDIR/pids/users/axel/pids.max


######################################################################

# Curl

mkdir -p $CGDIR/cpu/users/curl
echo '1'> $CGDIR/cpu/users/curl/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/curl/cpu.shares

mkdir -p $CGDIR/cpuacct/users/curl

# echo 250 >   $CGDIR/cpuacct/users/curl/cpuacct.usage

mkdir -p $CGDIR/cpuset/users/curl


mkdir -p $CGDIR/memory/users/curl
echo '1'> $CGDIR/memory/users/curl/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/curl/memory.soft_limit_in_bytes
echo '256m' > $CGDIR/memory/users/curl/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/curl/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/curl/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/curl/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/curl
echo '1' > $CGDIR/net_cls/users/curl/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/curl/net_cls.classid

mkdir -p  $CGDIR/pids/users/curl
echo '1' > $CGDIR/pids/users/curl/cgroup.clone_children
echo '8' > $CGDIR/pids/users/curl/pids.max

#################################################################################33
# Rtmpdump

mkdir -p $CGDIR/cpu/users/rtmpdump
echo '1'> $CGDIR/cpu/users/rtmpdump/cgroup.clone_children
echo 100 >   $CGDIR/cpu/users/rtmpdump/cpu.shares

#mkdir -p $CGDIR/cpuacct/users/tvtime
# echo 100 > $CGDIR/cpuacct/users/tvtime/cpuacct.usage

#mkdir -p $CGDIR/cpuset/users/rtmpdump


mkdir -p $CGDIR/memory/users/rtmpdump
echo '1'> $CGDIR/memory/users/rtmpdump/cgroup.clone_children
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/rtmpdump/memory.kmem.tcp.limit_in_bytes
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.limit_in_bytes
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/rtmpdump/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/rtmpdump
echo '1' > $CGDIR/net_cls/users/rtmpdump/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/rtmpdump/net_cls.classid

###############################################################################
# Xterm

mkdir -p  $CGDIR/blkio/system/xterm
echo '1' > $CGDIR/blkio/system/xterm/cgroup.clone_children
echo '600' > $CGDIR/blkio/system/xterm/blkio.weight

mkdir -p  $CGDIR/cpu/system/xterm
echo '1' > $CGDIR/cpu/system/xterm/cgroup.clone_children
echo '800' > $CGDIR/cpu/system/xterm/cpu.shares

mkdir -p  $CGDIR/memory/system/xterm
echo '1' > $CGDIR/memory/system/xterm/cgroup.clone_children
echo '3g' >   $CGDIR/memory/system/xterm/memory.soft_limit_in_bytes
echo '3g' >   $CGDIR/memory/system/xterm/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/system/xterm/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/system/xterm/memory.oom_control 

mkdir -p  $CGDIR/cpuset/system/xterm
echo -n '1' > $CGDIR/cpuset/system/xterm/cgroup.clone_children

mkdir -p  $CGDIR/pids/system/xterm
echo '1' > $CGDIR/pids/system/xterm/cgroup.clone_children
echo '128' > $CGDIR/pids/system/xterm/pids.max

####################################################################################
# sysmonitor

mkdir -p $CGDIR/cpu/users/sysmonitor
echo '1'> $CGDIR/cpu/users/sysmonitor/cgroup.clone_children
echo 100 >   $CGDIR/cpu/users/sysmonitor/cpu.shares


mkdir -p $CGDIR/memory/users/sysmonitor
echo '1'> $CGDIR/memory/users/sysmonitor/cgroup.clone_children
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/sysmonitor/memory.kmem.tcp.limit_in_bytes
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.limit_in_bytes
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/sysmonitor/memory.oom_control 

###############################################################################
# Konsola

mkdir -p  $CGDIR/blkio/system/shell
echo '1' > $CGDIR/blkio/system/shell/cgroup.clone_children
echo '600' > $CGDIR/blkio/system/shell/blkio.weight

mkdir -p  $CGDIR/cpu/system/shell
echo '1' > $CGDIR/cpu/system/shell/cgroup.clone_children
echo '800' > $CGDIR/cpu/system/shell/cpu.shares

mkdir -p  $CGDIR/memory/system/shell
echo '1' > $CGDIR/memory/system/shell/cgroup.clone_children
echo '3g' >   $CGDIR/memory/system/shell/memory.soft_limit_in_bytes
echo '3g' >   $CGDIR/memory/system/shell/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/system/shell/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/system/shell/memory.oom_control 

mkdir -p  $CGDIR/cpuset/system/shell
echo -n '1' > $CGDIR/cpuset/system/shell/cgroup.clone_children

mkdir -p  $CGDIR/pids/system/shell
echo '1' > $CGDIR/pids/system/shell/cgroup.clone_children
echo '1024' > $CGDIR/pids/system/shell/pids.max

###############################################################################

for release in `ls $CGDIR/*/*/*/notify_on_release`;
do echo 1 >$release; done;

for clone in `ls $CGDIR/*/*/*/cgroup.clone_children`;
do echo 1 >$clone; done;

for hierarchy in `ls $CGDIR/memory/*/*/memory.use_hierarchy`;
do echo 1 >$hierarchy; done;


echo "Zrobione :)"

SOA#1

Ostatnio edytowany przez Jacekalex (2018-07-28 20:32:32)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#10 2018-07-28 20:36:28

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Yes, Yes, Yes
Stosuje i dziekuje.
Strona idzie do archiwizacji natychmiast.

Ostatnio edytowany przez Novi-cjusz (2018-07-28 20:40:10)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#11 2018-07-28 23:25:33

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Myslalem, ze dalej sam pociagne - ale tylko myslalem (;-(
Sprawdzilem zawartosc i lokalizacje skryptow startowych i plikow configu, wszystko wydaje sie O,k a uslugi nie dzialaja.

Kod:

root@robin-desktop:/# systemctl start cgstart.service
Job for cgstart.service failed because the control process exited with error code. See "systemctl status cgstart.service" and "journalctl -xe" for details.
root@robin-desktop:/# systemctl status cgstart.service
● cgstart.service - "CGSTART - Zakładam strukturę grup do cgroup ;)"
   Loaded: loaded (/etc/systemd/system/cgstart.service; disabled; vendor preset:
   Active: failed (Result: exit-code) since Sat 2018-07-28 22:19:56 IST; 23s ago
  Process: 17474 ExecStart=/usr/local/sbin/cgstart (code=exited, status=203/EXEC
 Main PID: 17474 (code=exited, status=203/EXEC)

Jul 28 22:19:56 robin-desktop systemd[1]: Starting "CGSTART - Zakładam strukturę
Jul 28 22:19:56 robin-desktop systemd[1]: cgstart.service: Main process exited, 
Jul 28 22:19:56 robin-desktop systemd[1]: Failed to start "CGSTART - Zakładam st
Jul 28 22:19:56 robin-desktop systemd[1]: cgstart.service: Unit entered failed s
Jul 28 22:19:56 robin-desktop systemd[1]: cgstart.service: Failed with result 'e

root@robin-desktop:/# journalctl -xe
-- 
-- Unit dev-disk-by\x2duuid-33704977\x2d6cb2\x2d4b6f\x2dadc7\x2d1271084d24fa.dev
-- 
-- The result is timeout.
Jul 28 22:20:08 robin-desktop systemd[1]: Dependency failed for /dev/disk/by-uui
-- Subject: Unit dev-disk-by\x2duuid-33704977\x2d6cb2\x2d4b6f\x2dadc7\x2d1271084
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit dev-disk-by\x2duuid-33704977\x2d6cb2\x2d4b6f\x2dadc7\x2d1271084d24fa.swa
-- 
-- The result is dependency.
Jul 28 22:20:08 robin-desktop systemd[1]: dev-disk-by\x2duuid-33704977\x2d6cb2\x
Jul 28 22:20:08 robin-desktop systemd[1]: dev-disk-by\x2duuid-33704977\x2d6cb2\x
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:11 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 28 22:20:15 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC=33:33
Jul 28 22:20:22 robin-desktop upowerd[2302]: (upowerd:2302): UPower-Linux-WARNIN

root@robin-desktop:/# systemctl start cgred.service
^C
root@robin-desktop:/# systemctl status cgred.service
● cgred.service - "CGRULESENGD - zaczynam robotę ;)"
   Loaded: loaded (/etc/systemd/system/cgred.service; enabled; vendor preset: en
   Active: activating (start) since Sat 2018-07-28 21:11:34 IST; 1h 10min ago
 Main PID: 389 (cgrulesengd)
    Tasks: 1
   Memory: 6.0M
      CPU: 4.912s
   CGroup: /system.slice/cgred.service
           └─389 /usr/sbin/cgrulesengd --nodaemon --nolog

Jul 28 22:18:37 robin-desktop systemd[1]: [/etc/systemd/system/cgred.service:10]
Warning: Journal has been rotated since unit was started. Log output is incomple
lines 1-12/12 (END)...skipping...
● cgred.service - "CGRULESENGD - zaczynam robotę ;)"
   Loaded: loaded (/etc/systemd/system/cgred.service; enabled; vendor preset: en
   Active: activating (start) since Sat 2018-07-28 21:11:34 IST; 1h 10min ago
 Main PID: 389 (cgrulesengd)
    Tasks: 1
   Memory: 6.0M
      CPU: 4.912s
   CGroup: /system.slice/cgred.service
           └─389 /usr/sbin/cgrulesengd --nodaemon --nolog

Jul 28 22:18:37 robin-desktop systemd[1]: [/etc/systemd/system/cgred.service:10]
Warning: Journal has been rotated since unit was started. Log output is incomple
~
~
~
~
~
~
~
~
~
~
~
~
lines 1-12/12 (END)...skipping...
● cgred.service - "CGRULESENGD - zaczynam robotę ;)"
   Loaded: loaded (/etc/systemd/system/cgred.service; enabled; vendor preset: enabled)
   Active: activating (start) since Sat 2018-07-28 21:11:34 IST; 1h 10min ago
 Main PID: 389 (cgrulesengd)
    Tasks: 1
   Memory: 6.0M
      CPU: 4.912s
   CGroup: /system.slice/cgred.service
           └─389 /usr/sbin/cgrulesengd --nodaemon --nolog

Jul 28 22:18:37 robin-desktop systemd[1]: [/etc/systemd/system/cgred.service:10] Executable path is not absolute, ignoring: kill $(pgrep cgrul
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Logi systemowe nic nie mowia.

Zdrugiej strony, PID,y procesow trafiaja do plikow "tasks"

Kod:

cat /sys/fs/cgroup/net_cls/tasks
1
2
4
6
7
8
9
10
11
12
13
14
15
16
18
19
20
21
22
24
25
26
27
28
30
31
32
33
34
36
37
38
39
40
42
43
44
45
46
48
49
50
51
52
54
55
56
57
58
62
63
64
65
66
67
68
69
70
72
73
74
75
76
83
84
126
127
134
144
161
213
214
215
216
217
218
219
220
222
223
224
225
226
228
229
239
242
243
244
310
311
322
350
351
387
389
399
410
445
465
523
524
546
569
583
693
1146
1148
1154
1171
1223
1225
1236
1254
1259
1286
1288
1290
1291
1292
1293
1294
1295
1296
1297
1304
1314
1315
1337
1341
1348
1359
1362
1373
1390
1477
1478
1479
1499
1520
1545
1562
1583
1585
1594
1598
1607
1618
1630
1636
1641
1658
1659
1660
1668
1669
1670
1671
1687
1688
1689
1691
1693
1694
1695
1697
1698
1735
1757
1760
1764
1765
1766
1769
1770
1795
1879
1888
1900
1929
1948
1950
1953
1970
1993
1995
1997
1999
2009
2094
2095
2098
2148
2149
2152
2155
2156
2158
2159
2161
2162
2164
2165
2168
2169
2171
2176
2182
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2202
2203
2204
2205
2207
2210
2211
2212
2217
2219
2231
2239
2255
2256
2257
2259
2260
2261
2267
2268
2275
2277
2278
2295
2301
2302
2312
2313
2367
2369
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2384
2386
2387
2388
2390
2393
2395
2396
2397
2398
2399
2405
2406
2408
2409
2410
2411
2412
2413
2417
2418
2419
2420
2421
2422
2424
2426
2428
2429
2433
2435
2436
2437
2439
2441
2442
2443
2444
2446
2448
2449
2452
2453
2454
2456
2457
2458
2459
2469
2470
2474
2481
2490
2494
2522
2523
2524
2525
2526
2527
2528
2529
2530
2534
2544
2549
2552
2560
2562
2566
2567
2568
2570
2572
2573
2575
2577
2582
2583
2584
2592
2594
2596
2609
2610
2611
2619
2620
2622
2630
2631
2636
2638
2641
2659
2660
2661
2665
2666
2667
2668
2669
2670
2672
2673
2676
2677
2678
2679
2681
2684
2687
2688
2689
2690
2691
2694
2728
2735
2742
2743
2770
2782
2786
2801
2829
2836
2837
2838
2839
2842
2843
2844
2847
2848
2850
2856
2857
2869
2872
2899
2900
2910
2952
2986
2987
2991
3007
3034
3035
3052
3058
3061
3062
3063
3065
3066
3067
3145
3146
3147
3204
3207
3209
3211
3215
3216
3217
3222
3223
3224
3227
3228
3229
3230
3231
3232
3233
3234
3443
3444
3445
3446
3447
3448
3449
3450
3479
3485
3486
3487
3488
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3510
3512
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3535
3537
3542
3546
3551
3552
3553
3554
3555
3556
3557
3559
3560
3561
3562
3564
3587
3602
3603
3605
3610
3636
3650
3651
3652
3692
3698
3725
3862
3865
3866
3867
3903
3972
4296
4566
4573
4907
6181
6183
6184
6547
6549
6550
6552
6600
6601
6602
7915
8338
8656
8657
8658
9368
10473
10888
10889
10890
10891
10899
10901
10902
10903
10904
10905
10906
10907
10909
10910
10911
10912
10913
10914
10915
10916
13315
13775
14308
14312
15124
15696
15697
15698
15699
15703
15746
15780
15785
16949
16955
17064
17178
19329
19866
20632
20911
21631
21632
21633
21634
21635
21639
21641
21644
21645
21646
21938
21940
21943
21944
21954
22037
22744
22967
23263
23807
23876

co oznacz, ze demon dziala i jest dobrze skonfigurowany.
Jak to wlasciwie zinterpretowac?
Bardzo wazne pytanie:
Jaka komenda sprawdzic ktore procesy siedza w ktorych cgroups ??

Ostatnio edytowany przez Novi-cjusz (2018-07-28 23:54:22)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#12 2018-07-29 00:35:13

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Czy demon działa?

Kod:

ps aux | grep cgrules

Czy jakieś grupy są zrobione?

Kod:

cat /proc/cgroups

Skrypt odpalasz najpierw z palca, żeby zobaczyć czy działa.

Kod:

/usr/local/sbin/cgstart

Ostatnio edytowany przez Jacekalex (2018-07-29 00:36:02)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#13 2018-07-29 00:48:16

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Wyglada na to, ze na wszystkie 3 pytania odpowiedz jest pozytywna:

Kod:

root@robin-desktop:/# ps aux | grep cgrules
root       389  0.1  0.0  14720  5668 ?        Ss   21:11   0:10 /usr/sbin/cgrulesengd --nodaemon --nolog
root      2121  0.0  0.0  21292   940 pts/2    S+   23:44   0:00 grep --color=auto cgrules
root      4907  0.1  0.0  14720  5800 ?        Ss   21:19   0:09 cgrulesengd -v -f /var/log/cgrulesengd
root@robin-desktop:/# cat /proc/cgroups
#subsys_name    hierarchy    num_cgroups    enabled
cpuset    8    1    1
cpu    7    83    1
cpuacct    7    83    1
blkio    12    83    1
memory    9    139    1
devices    10    83    1
freezer    3    6    1
net_cls    2    1    1
perf_event    11    1    1
net_prio    2    1    1
hugetlb    6    1    1
pids    5    83    1
rdma    4    1    1
root@robin-desktop:/# /usr/local/sbin/cgstart
bash: /usr/local/sbin/cgstart: Permission denied

Kod:

root@robin-desktop:/# ps aux | grep cgstart
root      4250  0.0  0.0  21292   964 pts/2    S+   23:53   0:00 grep --color=auto cgstart
root@robin-desktop:/# ps aux | grep cgconfig
root      4421  0.0  0.0  21292   968 pts/2    S+   23:54   0:00 grep --color=auto cgconfig

Zmuszony jestem wrocic do pytania:

Jaka komenda sprawdzic ktore procesy siedza w ktorych cgroups ??

Przyklad;
- cgroup1 - firefox
lub
- firefox - cgroup1
Tak zeby numeryczne cgroups byly powiazane z procesami, ktore w nich siedza.

Ostatnio edytowany przez Novi-cjusz (2018-07-29 00:52:30)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#14 2018-07-29 01:00:29

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Skrypty potrzebują atrybutu wykonania, wtedy trochę lepiej działają. :P

Kod:

chmod 700 /usr/local/sbin/cgstart

Kod:

systemctl restart cgstart.service
systemctl restart cgred.service

Ostatnio edytowany przez Jacekalex (2018-07-29 01:01:39)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#15 2018-07-29 01:20:27

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Bez zmian:

Kod:

root@robin-desktop:/# chmod 700 /usr/local/sbin/cgstart
root@robin-desktop:/# systemctl restart cgstart.service
Job for cgstart.service failed because the control process exited with error code. See "systemctl status cgstart.service" and "journalctl -xe" for details.
root@robin-desktop:/# systemctl status cgstart.service
● cgstart.service - "CGSTART - Zakładam strukturę grup do cgroup ;)"
   Loaded: loaded (/etc/systemd/system/cgstart.service; disabled; vendor preset:
   Active: failed (Result: exit-code) since Sun 2018-07-29 00:20:54 IST; 14s ago
  Process: 9685 ExecStart=/usr/local/sbin/cgstart (code=exited, status=203/EXEC)
 Main PID: 9685 (code=exited, status=203/EXEC)

Jul 29 00:20:54 robin-desktop systemd[1]: Starting "CGSTART - Zakładam strukturę
Jul 29 00:20:54 robin-desktop systemd[1]: cgstart.service: Main process exited, 
Jul 29 00:20:54 robin-desktop systemd[1]: Failed to start "CGSTART - Zakładam st
Jul 29 00:20:54 robin-desktop systemd[1]: cgstart.service: Unit entered failed s
Jul 29 00:20:54 robin-desktop systemd[1]: cgstart.service: Failed with result 'e

root@robin-desktop:/# journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit cgstart.service has failed.
-- 
-- The result is failed.
Jul 29 00:20:54 robin-desktop systemd[1]: cgstart.service: Unit entered failed s
Jul 29 00:20:54 robin-desktop systemd[1]: cgstart.service: Failed with result 'e
Jul 29 00:20:54 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=01:00:
Jul 29 00:20:54 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC=33:33
Jul 29 00:20:57 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC=33:33
Jul 29 00:21:10 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=01:00:
Jul 29 00:21:10 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC=33:33
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:24 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC=ff:ff:
Jul 29 00:21:27 robin-desktop kernel: IPTABLES-DROPPED:IN=enp3s0 OUT= MAC= SRC=1
Jul 29 00:21:27 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC= SRC=
Jul 29 00:21:28 robin-desktop kernel: IP6TABLES-DROPPED:IN=enp3s0 OUT= MAC=33:33

root@robin-desktop:/# systemctl restart cgred.service
^C
root@robin-desktop:/# systemctl status cgred.service
● cgred.service - "CGRULESENGD - zaczynam robotę ;)"
   Loaded: loaded (/etc/systemd/system/cgred.service; enabled; vendor preset: en
   Active: activating (start) since Sun 2018-07-29 00:21:57 IST; 26s ago
 Main PID: 9919 (cgrulesengd)
    Tasks: 1
   Memory: 4.3M
      CPU: 57ms
   CGroup: /system.slice/cgred.service
           └─9919 /usr/sbin/cgrulesengd --nodaemon --nolog

Jul 29 00:21:57 robin-desktop systemd[1]: Starting "CGRULESENGD - zaczynam robot

root@robin-desktop:/#

Ostatnio edytowany przez Novi-cjusz (2018-07-29 01:55:08)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#16 2018-07-29 14:22:28

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Z palca zobacz, czy się wykonuje, i z jakim oudputem.

Kod:

/usr/local/sbin/cgstart

W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#17 2018-07-29 14:28:14

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Poniewaz od nadmiaru glowa boli, zrobilem remanent z 2 dotychczasowych opcji:

1 - Jacekalex (uzyte pliki i lokalizacje)
      - cgstart.service (hierarchia - struktura grup)             <---> /etc/systemd/sytem/cgstart.service
      - cgrules.conf  (konfig do cgstart.service)                  <---> /etc/cgroup/cgrules.conf
      - cgstart (skrypt startowy)                                          <---> /usr/local/sbin/cgstart
      - cgred.service (cgrulesngd - przydzielanie PID'ow)  <---> /etc/systemd/sytem/cgred.service
Comment: Obydwie uslugi: tzn cgstart.service i cgred.service = Loaded, Failed

2 - Novicjusz (uzyte pliki i lokalizacje)
    - cgconfig.service (hierarchia - struktura grup)           <---> /lib/systemd/system/cgconfig.service
    - cgconfig.conf  (konfig do cgconfig.service)               <---> /etc/cgconfig.conf
    - cgred.service (cgrulesngd - przydzielanie PID'ow)  <---> /lib/systemd/system/cgred.service
    - cgred.conf  (konfig do cgred.service)                       <---> /etc/cgred.conf
    - cgrules.conf (budowa cgrups)                                   <---> /etc/cgrules.conf
Comment: Obydwie uslugi tzn: cgconfig.service + cgred.service = Loaded Active.
                 Klopot z konfiguracja plikow: cgconfig.conf + cgrules.conf

Pytanie: Jak zrobic z tego dzialajaca konfiguracje cgroups????

Kod:

root@robin-desktop:/# /usr/local/sbin/cgstart
/usr/local/sbin/cgstart: line 1: !/bin/bash: No such file or directory
/usr/local/sbin/cgstart: line 26: /sys/fs/cgroup//memory/users/xorg/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 53: /sys/fs/cgroup//memory/users/kde/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 88: /sys/fs/cgroup//memory/users/mate/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 122: /sys/fs/cgroup//memory/users/xfce/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 189: /sys/fs/cgroup//memory/users/chrome/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 225: /sys/fs/cgroup//memory/users/opera/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 256: /sys/fs/cgroup//memory/users/pidgin/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 288: /sys/fs/cgroup//memory/users/kadu/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 320: /sys/fs/cgroup//memory/users/kopete/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 354: /sys/fs/cgroup//memory/users/choqok/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 386: /sys/fs/cgroup//memory/users/linphone/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 419: /sys/fs/cgroup//memory/users/vlc/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 448: /sys/fs/cgroup//memory/users/audacious/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 480: /sys/fs/cgroup//memory/users/thunderbird/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 512: /sys/fs/cgroup//memory/users/fetchmail/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 542: /sys/fs/cgroup//memory/voip/skype/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 577: /sys/fs/cgroup//memory/users/mplayer/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 606: /sys/fs/cgroup//memory/users/minitube/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 636: /sys/fs/cgroup//memory/users/kaffeine/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 667: /sys/fs/cgroup//memory/users/liferea/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 696: /sys/fs/cgroup//memory/users/firefox/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 725: /sys/fs/cgroup//memory/users/akregator/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 758: /sys/fs/cgroup//memory/users/quiterss/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 791: /sys/fs/cgroup//memory/users/totem/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 821: /sys/fs/cgroup//memory/users/wget/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 848: /sys/fs/cgroup//memory/users/axel/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 881: /sys/fs/cgroup//memory/users/curl/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 910: /sys/fs/cgroup//memory/users/rtmpdump/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 932: /sys/fs/cgroup//memory/system/xterm/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 955: /sys/fs/cgroup//memory/users/sysmonitor/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 973: /sys/fs/cgroup//memory/system/shell/memory.memsw.limit_in_bytes: Permission denied
Zrobione :)

Ostatnio edytowany przez Novi-cjusz (2018-07-29 14:29:59)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#18 2018-07-29 14:30:36

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Najpierw masz sprawdzić, czy skrypt z palca działa.  czy znowu edytowałeś go w gedicie albo jakimś libreoffice i się cała zawartość spierdoliła przez jakieś znaki niedrukowane, bzdurne kodowania czy inne bzdury.


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#19 2018-07-29 14:33:12

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Nic takiego nie robilem - zawartosc tylko skopiowalem i przenioslem.
Tak to wyglada w lokalizacji  /usr/local/sbin/cgstart:

Kod:

!/bin/bash

awk 'NR>1 {print $1}' /proc/cgroups | while read -r a; 
do   b="/sys/fs/cgroup/$a";   mkdir -p "$b";  
 mount -tcgroup -o"$a" "cgroup:$a" "$b" 2>/dev/null; done
 
CGDIR='/sys/fs/cgroup/'

for clone in `ls $CGDIR/*/cgroup.clone_children`;
do echo 1 >$clone; done;

####################################################################################
# xorg
mkdir -p  $CGDIR/blkio/users/xorg
echo '1' > $CGDIR/blkio/users/xorg/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/xorg/blkio.weight

mkdir -p  $CGDIR/cpu/users/xorg
echo '1' > $CGDIR/cpu/users/xorg/cgroup.clone_children
echo '800' > $CGDIR/cpu/users/xorg/cpu.shares

mkdir -p  $CGDIR/memory/users/xorg
echo '1' > $CGDIR/memory/users/xorg/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/xorg/memory.soft_limit_in_bytes
echo '128m' >   $CGDIR/memory/users/xorg/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/xorg/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/xorg/memory.oom_control 

mkdir -p  $CGDIR/cpuset/users/xorg
echo -n '1' > $CGDIR/cpuset/users/xorg/cgroup.clone_children

mkdir -p  $CGDIR/pids/users/xorg
echo '1' > $CGDIR/pids/users/xorg/cgroup.clone_children
echo '16' > $CGDIR/pids/users/xorg/pids.max

####################################################################################

# KDE

mkdir -p $CGDIR/cpu/users/kde
echo '1'> $CGDIR/cpu/users/kde/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/kde/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kde

mkdir -p $CGDIR/cpuset/users/kde


mkdir -p $CGDIR/memory/users/kde
echo '1'> $CGDIR/memory/users/kde/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/kde/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/kde/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/kde/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/users/kde/memory.kmem.tcp.limit_in_bytes
echo '0' >   $CGDIR/memory/users/kde/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/kde
echo '1' > $CGDIR/net_cls/users/kde/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/kde/net_cls.classid

mkdir -p  $CGDIR/blkio/users/kde
echo '1' > $CGDIR/blkio/users/kde/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kde/blkio.weight

mkdir -p  $CGDIR/pids/users/kde
echo '1' > $CGDIR/pids/users/kde/cgroup.clone_children
echo '400' > $CGDIR/pids/users/kde/pids.max

#################################################################################


# Mate

mkdir -p $CGDIR/cpu/users/mate
echo '1'> $CGDIR/cpu/users/mate/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/mate/cpu.shares

mkdir -p $CGDIR/cpuacct/users/mate

mkdir -p $CGDIR/cpuset/users/mate


mkdir -p $CGDIR/memory/users/mate
echo '1'> $CGDIR/memory/users/mate/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/mate/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/mate/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/mate/memory.memsw.limit_in_bytes
echo '2048m' > $CGDIR/memory/users/mate/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/mate/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/mate
echo '1' > $CGDIR/net_cls/users/mate/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/mate/net_cls.classid

mkdir -p  $CGDIR/blkio/users/mate
echo '1' > $CGDIR/blkio/users/mate/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/mate/blkio.weight

mkdir -p  $CGDIR/pids/users/mate
echo '1' > $CGDIR/pids/users/mate/cgroup.clone_children
echo '200' > $CGDIR/pids/users/mate/pids.max

################################################################################

###  XFCE4

mkdir -p $CGDIR/cpu/users/xfce
echo '1'> $CGDIR/cpu/users/xfce/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/xfce/cpu.shares

mkdir -p $CGDIR/cpuacct/users/xfce

mkdir -p $CGDIR/cpuset/users/xfce


mkdir -p $CGDIR/memory/users/xfce
echo '1'> $CGDIR/memory/users/xfce/cgroup.clone_children
echo '2048m' >   $CGDIR/memory/users/xfce/memory.soft_limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/xfce/memory.limit_in_bytes
echo '2048m' >   $CGDIR/memory/users/xfce/memory.memsw.limit_in_bytes
echo '2048m' > $CGDIR/memory/users/xfce/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/xfce/memory.oom_control


mkdir -p $CGDIR/net_cls/users/xfce
echo '1' > $CGDIR/net_cls/users/xfce/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/xfce/net_cls.classid

mkdir -p  $CGDIR/blkio/users/xfce
echo '1' > $CGDIR/blkio/users/xfce/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/xfce/blkio.weight

mkdir -p  $CGDIR/pids/users/xfce
echo '1' > $CGDIR/pids/users/xfce/cgroup.clone_children
echo '200' > $CGDIR/pids/users/xfce/pids.max





#################################################################################

# GPG

mkdir -p $CGDIR/cpu/users/gpg
echo '1'> $CGDIR/cpu/users/gpg/cgroup.clone_children
echo '300' >   $CGDIR/cpu/users/gpg/cpu.shares

mkdir -p $CGDIR/cpuacct/users/gpg
# echo 100 > $CGDIR/cpuacct/users/tvtime/cpuacct.usage

mkdir -p $CGDIR/cpuset/users/gpg


mkdir -p $CGDIR/memory/users/gpg
echo '1'> $CGDIR/memory/users/gpg/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/gpg/memory.soft_limit_in_bytes

mkdir -p $CGDIR/net_cls/users/gpg
echo '1' > $CGDIR/net_cls/users/gpg/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/gpg/net_cls.classid


####################################################################################
# NETOUT

mkdir -p $CGDIR/net_cls/users/netout
echo '1' > $CGDIR/net_cls/users/netout/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/netout/net_cls.classid

####################################################################################
# Google-chrome

mkdir -p $CGDIR/cpu/users/chrome
echo '1'> $CGDIR/cpu/users/chrome/cgroup.clone_children
echo '600' > $CGDIR/cpu/users/chrome/cpu.shares

mkdir -p $CGDIR/cpuacct/users/chrome

mkdir -p $CGDIR/cpuset/users/chrome


mkdir -p $CGDIR/memory/users/chrome
echo '1'> $CGDIR/memory/users/chrome/cgroup.clone_children
echo '4096m' >   $CGDIR/memory/users/chrome/memory.soft_limit_in_bytes
echo '4096m' >   $CGDIR/memory/users/chrome/memory.limit_in_bytes
echo '4096m' >   $CGDIR/memory/users/chrome/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/users/chrome/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/chrome/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/chrome
echo '1' > $CGDIR/net_cls/users/chrome/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/chrome/net_cls.classid

mkdir -p  $CGDIR/blkio/users/chrome
echo '1' > $CGDIR/blkio/users/chrome/cgroup.clone_children
echo '100' > $CGDIR/blkio/users/chrome/blkio.weight


mkdir -p  $CGDIR/pids/users/chrome
echo '1' > $CGDIR/pids/users/chrome/cgroup.clone_children
echo '256' > $CGDIR/pids/users/chrome/pids.max

#################################################################################

#  Opera

mkdir -p $CGDIR/cpu/users/opera
echo '1'> $CGDIR/cpu/users/opera/cgroup.clone_children
echo '300' > $CGDIR/cpu/users/opera/cpu.shares

mkdir -p $CGDIR/cpuacct/users/opera

mkdir -p $CGDIR/cpuset/users/opera


mkdir -p $CGDIR/memory/users/opera
echo '1'> $CGDIR/memory/users/opera/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/opera/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/opera/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/opera/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/opera/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/opera/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/opera
echo '1' > $CGDIR/net_cls/users/opera/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/opera/net_cls.classid

mkdir -p  $CGDIR/pids/users/opera
echo '1' > $CGDIR/pids/users/opera/cgroup.clone_children
echo '32' > $CGDIR/pids/users/opera/pids.max


#################################################################################

# Pidgin

mkdir -p $CGDIR/cpu/users/pidgin
echo '1'> $CGDIR/cpu/users/pidgin/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/pidgin/cpu.shares

mkdir -p $CGDIR/cpuacct/users/pidgin

mkdir -p $CGDIR/cpuset/users/pidgin


mkdir -p $CGDIR/memory/users/pidgin
echo '1'> $CGDIR/memory/users/pidgin/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/pidgin/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/pidgin/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/pidgin/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/pidgin/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/pidgin/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/pidgin
echo '1' > $CGDIR/blkio/users/pidgin/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/pidgin/blkio.weight

mkdir -p $CGDIR/net_cls/users/pidgin
echo '1' > $CGDIR/net_cls/users/pidgin/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/pidgin/net_cls.classid

mkdir -p  $CGDIR/pids/users/pidgin
echo '1' > $CGDIR/pids/users/pidgin/cgroup.clone_children
echo '16' > $CGDIR/pids/users/pidgin/pids.max

##################################################################################

# kadu

mkdir -p $CGDIR/cpu/users/kadu
echo '1'> $CGDIR/cpu/users/kadu/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/kadu/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kadu

mkdir -p $CGDIR/cpuset/users/kadu

mkdir -p $CGDIR/memory/users/kadu
echo '1'> $CGDIR/memory/users/kadu/cgroup.clone_children
echo '160m' >   $CGDIR/memory/users/kadu/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/kadu/memory.kmem.tcp.limit_in_bytes
echo '160m' >   $CGDIR/memory/users/kadu/memory.limit_in_bytes
echo '160m' >   $CGDIR/memory/users/kadu/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kadu/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/kadu
echo '1' > $CGDIR/blkio/users/kadu/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kadu/blkio.weight

mkdir -p $CGDIR/net_cls/users/kadu
echo '1' > $CGDIR/net_cls/users/kadu/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/kadu/net_cls.classid

mkdir -p  $CGDIR/pids/users/kadu
echo '1' > $CGDIR/pids/users/kadu/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kadu/pids.max

##################################################################################

#Kopete

mkdir -p $CGDIR/cpu/users/kopete
echo '1'> $CGDIR/cpu/users/kopete/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/kopete/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kopete

mkdir -p $CGDIR/cpuset/users/kopete

mkdir -p $CGDIR/memory/users/kopete
echo '1'> $CGDIR/memory/users/kopete/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/kopete/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/kopete/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/kopete/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/kopete/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kopete/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/kopete
echo '1' > $CGDIR/blkio/users/kopete/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/kopete/blkio.weight

mkdir -p $CGDIR/net_cls/users/kopete
echo '1' > $CGDIR/net_cls/users/kopete/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/kopete/net_cls.classid

mkdir -p  $CGDIR/pids/users/kopete
echo '1' > $CGDIR/pids/users/kopete/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kopete/pids.max


##################################################################################

# Choqok

mkdir -p $CGDIR/cpu/users/choqok
echo '1'> $CGDIR/cpu/users/choqok/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/choqok/cpu.shares

mkdir -p $CGDIR/cpuacct/users/choqok

mkdir -p $CGDIR/cpuset/users/choqok


mkdir -p $CGDIR/memory/users/choqok
echo '1'> $CGDIR/memory/users/choqok/cgroup.clone_children
echo '384m' >   $CGDIR/memory/users/choqok/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/choqok/memory.kmem.tcp.limit_in_bytes
echo '384m' >   $CGDIR/memory/users/choqok/memory.limit_in_bytes
echo '384m' >   $CGDIR/memory/users/choqok/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/choqok/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/choqok
echo '1' > $CGDIR/blkio/users/choqok/cgroup.clone_children
echo '500' > $CGDIR/blkio/users/choqok/blkio.weight

mkdir -p $CGDIR/net_cls/users/choqok
echo '1' > $CGDIR/net_cls/users/choqok/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/choqok/net_cls.classid

mkdir -p  $CGDIR/pids/users/choqok
echo '1' > $CGDIR/pids/users/choqok/cgroup.clone_children
echo '64' > $CGDIR/pids/users/choqok/pids.max


##################################################################################
#linphone

mkdir -p $CGDIR/cpu/users/linphone
echo '1'> $CGDIR/cpu/users/linphone/cgroup.clone_children
echo '250' > $CGDIR/cpu/users/linphone/cpu.shares

mkdir -p $CGDIR/cpuacct/users/linphone

mkdir -p $CGDIR/cpuset/users/linphone

mkdir -p $CGDIR/memory/users/linphone
echo '1'> $CGDIR/memory/users/linphone/cgroup.clone_children
echo '128m' >   $CGDIR/memory/users/linphone/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/linphone/memory.kmem.tcp.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/linphone/memory.limit_in_bytes
echo '128m' >   $CGDIR/memory/users/linphone/memory.memsw.limit_in_bytes
echo '0' >   $CGDIR/memory/users/linphone/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/linphone
echo '1' > $CGDIR/blkio/users/linphone/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/linphone/blkio.weight

mkdir -p $CGDIR/net_cls/users/linphone
echo '1' > $CGDIR/net_cls/users/linphone/cgroup.clone_children
echo '1' > $CGDIR/net_cls/users/linphone/net_cls.classid

mkdir -p  $CGDIR/pids/users/linphone
echo '1' > $CGDIR/pids/users/linphone/cgroup.clone_children
echo '16' > $CGDIR/pids/users/linphone/pids.max

##################################################################################

# Vlc

mkdir -p $CGDIR/cpu/users/vlc
echo '1'> $CGDIR/cpu/users/vlc/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/vlc/cpu.shares

mkdir -p $CGDIR/cpuacct/users/vlc

mkdir -p $CGDIR/cpuset/users/vlc


mkdir -p $CGDIR/memory/users/vlc
echo '1'> $CGDIR/memory/users/vlc/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/vlc/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/vlc/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/vlc/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/vlc/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/vlc/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/vlc
echo '1' > $CGDIR/net_cls/users/vlc/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/vlc/net_cls.classid

mkdir -p  $CGDIR/pids/users/vlc
echo '1' > $CGDIR/pids/users/vlc/cgroup.clone_children
echo '16' > $CGDIR/pids/users/vlc/pids.max

####################################################################################
# Audacious

mkdir -p $CGDIR/cpu/users/audacious
echo '1'> $CGDIR/cpu/users/audacious/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/audacious/cpu.shares

mkdir -p $CGDIR/cpuacct/users/audacious

mkdir -p $CGDIR/cpuset/users/audacious


mkdir -p $CGDIR/memory/users/audacious
echo '1'> $CGDIR/memory/users/audacious/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/audacious/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/audacious/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/audacious/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/audacious/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/audacious/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/audacious
echo '1' > $CGDIR/blkio/users/audacious/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/audacious/blkio.weight

mkdir -p $CGDIR/net_cls/users/audacious
echo '1' > $CGDIR/net_cls/users/audacious/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/audacious/net_cls.classid

mkdir -p  $CGDIR/pids/users/audacious
echo '1' > $CGDIR/pids/users/audacious/cgroup.clone_children
echo '16' > $CGDIR/pids/users/audacious/pids.max


##########################################################################################
# Thunderbird

mkdir -p $CGDIR/cpu/users/thunderbird
echo '1'> $CGDIR/cpu/users/thunderbird/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/thunderbird/cpu.shares

mkdir -p $CGDIR/cpuacct/users/thunderbird

mkdir -p $CGDIR/cpuset/users/thunderbird

mkdir -p $CGDIR/memory/users/thunderbird
echo '1'> $CGDIR/memory/users/thunderbird/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/thunderbird/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/thunderbird/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/thunderbird/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/thunderbird
echo '1' > $CGDIR/net_cls/users/thunderbird/cgroup.clone_children
echo '9' > $CGDIR/net_cls/users/thunderbird/net_cls.classid

mkdir -p  $CGDIR/blkio/users/thunderbird
echo '1' > $CGDIR/blkio/users/thunderbird/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/thunderbird/blkio.weight

mkdir -p  $CGDIR/pids/users/thunderbird
echo '1' > $CGDIR/pids/users/thunderbird/cgroup.clone_children
echo '128' > $CGDIR/pids/users/thunderbird/pids.max

##################################################################################

# fetchmail

mkdir -p $CGDIR/cpu/users/fetchmail
echo '1'> $CGDIR/cpu/users/fetchmail/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/fetchmail/cpu.shares

mkdir -p $CGDIR/cpuacct/users/fetchmail

mkdir -p $CGDIR/cpuset/users/fetchmail

mkdir -p $CGDIR/memory/users/fetchmail
echo '1'> $CGDIR/memory/users/fetchmail/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/fetchmail/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/fetchmail/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/fetchmail/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/fetchmail
echo '1' > $CGDIR/net_cls/users/fetchmail/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/fetchmail/net_cls.classid

mkdir -p  $CGDIR/blkio/users/fetchmail
echo '1' > $CGDIR/blkio/users/fetchmail/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/fetchmail/blkio.weight

mkdir -p  $CGDIR/pids/users/fetchmail
echo '1' > $CGDIR/pids/users/fetchmail/cgroup.clone_children
echo '64' > $CGDIR/pids/users/fetchmail/pids.max

###################################################################################

mkdir -p $CGDIR/cpu/voip/skype
echo '1'> $CGDIR/cpu/voip/skype/cgroup.clone_children
echo '300' > $CGDIR/cpu/voip/skype/cpu.shares

mkdir -p $CGDIR/cpuacct/voip/skype

mkdir -p $CGDIR/cpuset/voip/skype


mkdir -p $CGDIR/memory/voip/skype
echo '1'> $CGDIR/memory/voip/skype/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/voip/skype/memory.soft_limit_in_bytes
echo '1024m' >   $CGDIR/memory/voip/skype/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/voip/skype/memory.memsw.limit_in_bytes
echo '32m' > $CGDIR/memory/voip/skype/memory.kmem.tcp.limit_in_bytes
echo '0'  >   $CGDIR/memory/voip/skype/memory.oom_control 


mkdir -p $CGDIR/net_cls/voip/skype
echo '1' > $CGDIR/net_cls/voip/skype/cgroup.clone_children
echo '4' > $CGDIR/net_cls/voip/skype/net_cls.classid

mkdir -p  $CGDIR/blkio/voip/skype
echo '1' > $CGDIR/blkio/voip/skype/cgroup.clone_children
echo '100' > $CGDIR/blkio/voip/skype/blkio.weight


mkdir -p  $CGDIR/pids/voip/skype
echo '1' > $CGDIR/pids/voip/skype/cgroup.clone_children
echo '256' > $CGDIR/pids/voip/skype/pids.max
#############################################################################

# Mplayer

mkdir -p $CGDIR/cpu/users/mplayer
echo '1'> $CGDIR/cpu/users/mplayer/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/mplayer/cpu.shares

mkdir -p $CGDIR/cpuacct/users/mplayer

mkdir -p $CGDIR/cpuset/users/mplayer


mkdir -p $CGDIR/memory/users/mplayer
echo '1'> $CGDIR/memory/users/mplayer/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/mplayer/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/mplayer/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/mplayer/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/mplayer/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/mplayer/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/mplayer
echo '1' > $CGDIR/net_cls/users/mplayer/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/mplayer/net_cls.classid

mkdir -p  $CGDIR/pids/users/mplayer
echo '1' > $CGDIR/pids/users/mplayer/cgroup.clone_children
echo '16' > $CGDIR/pids/users/mplayer/pids.max

#######################################################################################
# Minitube

mkdir -p $CGDIR/cpu/users/minitube
echo '1'> $CGDIR/cpu/users/minitube/cgroup.clone_children
echo '600' >   $CGDIR/cpu/users/minitube/cpu.shares

mkdir -p $CGDIR/cpuacct/users/minitube

mkdir -p $CGDIR/cpuset/users/minitube


mkdir -p $CGDIR/memory/users/minitube
echo '1'> $CGDIR/memory/users/minitube/cgroup.clone_children
echo '3g' >   $CGDIR/memory/users/minitube/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/minitube/memory.kmem.tcp.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/minitube/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/users/minitube/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/minitube/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/minitube
echo '1' > $CGDIR/net_cls/users/minitube/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/minitube/net_cls.classid

mkdir -p  $CGDIR/pids/users/minitube
echo '1' > $CGDIR/pids/users/minitube/cgroup.clone_children
echo '16' > $CGDIR/pids/users/minitube/pids.max

#######################################################################################

# Kaffeine

mkdir -p $CGDIR/cpu/users/kaffeine
echo '1'> $CGDIR/cpu/users/kaffeine/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/kaffeine/cpu.shares

mkdir -p $CGDIR/cpuacct/users/kaffeine

mkdir -p $CGDIR/cpuset/users/kaffeine


mkdir -p $CGDIR/memory/users/kaffeine
echo '1'> $CGDIR/memory/users/kaffeine/cgroup.clone_children
echo '256m'  >   $CGDIR/memory/users/kaffeine/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/kaffeine/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/kaffeine/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/kaffeine/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/kaffeine/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/kaffeine
echo '1' > $CGDIR/net_cls/users/kaffeine/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/kaffeine/net_cls.classid

mkdir -p  $CGDIR/pids/users/kaffeine
echo '1' > $CGDIR/pids/users/kaffeine/cgroup.clone_children
echo '16' > $CGDIR/pids/users/kaffeine/pids.max


##########################################################################################

# Liferea

mkdir -p $CGDIR/cpu/users/liferea
echo '1'> $CGDIR/cpu/users/liferea/cgroup.clone_children
echo '250' >   $CGDIR/cpu/users/liferea/cpu.shares

mkdir -p $CGDIR/cpuacct/users/liferea

mkdir -p $CGDIR/cpuset/users/liferea


mkdir -p $CGDIR/memory/users/liferea
echo '1'> $CGDIR/memory/users/liferea/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/liferea/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/liferea/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/liferea/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/liferea/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/liferea/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/liferea
echo '1' > $CGDIR/net_cls/users/liferea/cgroup.clone_children
echo '3' > $CGDIR/net_cls/users/liferea/net_cls.classid

mkdir -p  $CGDIR/pids/users/liferea
echo '1' > $CGDIR/pids/users/liferea/cgroup.clone_children
echo '16' > $CGDIR/pids/users/liferea/pids.max

############################################################################

# Firefox 

mkdir -p $CGDIR/cpu/users/firefox
echo 1 > $CGDIR/cpu/users/firefox/cgroup.clone_children
echo "100" > $CGDIR/cpu/users/firefox/cpu.shares

mkdir -p  $CGDIR/blkio/users/firefox
echo '1' > $CGDIR/blkio/users/firefox/cgroup.clone_children
echo '400' > $CGDIR/blkio/users/firefox/blkio.weight

mkdir -p $CGDIR/memory/users/firefox
echo '1'> $CGDIR/memory/users/firefox/cgroup.clone_children
echo '2g' >   $CGDIR/memory/users/firefox/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/firefox/memory.kmem.tcp.limit_in_bytes
echo '2g' >   $CGDIR/memory/users/firefox/memory.limit_in_bytes
echo '2g' >   $CGDIR/memory/users/firefox/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/firefox/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/firefox
echo '3' > $CGDIR/net_cls/users/firefox/net_cls.classid
echo '1' > $CGDIR/net_cls/users/firefox/cgroup.clone_children

mkdir -p  $CGDIR/pids/users/firefox
echo '1' > $CGDIR/pids/users/firefox/cgroup.clone_children
echo '256' > $CGDIR/pids/users/firefox/pids.max

###############################################################################

# Akregator

mkdir -p $CGDIR/cpu/users/akregator
echo '1'> $CGDIR/cpu/users/akregator/cgroup.clone_children
echo '400' >   $CGDIR/cpu/users/akregator/cpu.shares

mkdir -p $CGDIR/cpuacct/users/akregator
mkdir -p $CGDIR/cpuset/users/akregator


mkdir -p $CGDIR/memory/users/akregator
echo '1'> $CGDIR/memory/users/akregator/cgroup.clone_children
echo '1536m' >   $CGDIR/memory/users/akregator/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/akregator/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/akregator/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/akregator/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/akregator/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/akregator
echo '1' > $CGDIR/blkio/users/akregator/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/akregator/blkio.weight

mkdir -p $CGDIR/net_cls/users/akregator
echo '1' > $CGDIR/net_cls/users/akregator/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/akregator/net_cls.classid


mkdir -p  $CGDIR/pids/users/akregator
echo '1' > $CGDIR/pids/users/akregator/cgroup.clone_children
echo '512' > $CGDIR/pids/users/akregator/pids.max

###############################################################################

# QuiteRSS

mkdir -p $CGDIR/cpu/users/quiterss
echo '1'> $CGDIR/cpu/users/quiterss/cgroup.clone_children
echo '200' >   $CGDIR/cpu/users/quiterss/cpu.shares

mkdir -p $CGDIR/cpuacct/users/quiterss
mkdir -p $CGDIR/cpuset/users/quiterss


mkdir -p $CGDIR/memory/users/quiterss
echo '1'> $CGDIR/memory/users/quiterss/cgroup.clone_children
echo '512m' >   $CGDIR/memory/users/quiterss/memory.soft_limit_in_bytes
echo '16m' > $CGDIR/memory/users/quiterss/memory.kmem.tcp.limit_in_bytes
echo '512m' >   $CGDIR/memory/users/quiterss/memory.limit_in_bytes
echo '512m' >   $CGDIR/memory/users/quiterss/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/quiterss/memory.oom_control 

mkdir -p  $CGDIR/blkio/users/quiterss
echo '1' > $CGDIR/blkio/users/quiterss/cgroup.clone_children
echo '200' > $CGDIR/blkio/users/quiterss/blkio.weight

mkdir -p $CGDIR/net_cls/users/quiterss
echo '1' > $CGDIR/net_cls/users/quiterss/cgroup.clone_children
echo '8' > $CGDIR/net_cls/users/quiterss/net_cls.classid


mkdir -p  $CGDIR/pids/users/quiterss
echo '1' > $CGDIR/pids/users/quiterss/cgroup.clone_children
echo '64' > $CGDIR/pids/users/quiterss/pids.max


#####################################################################################

# Totem

mkdir -p $CGDIR/cpu/users/totem
echo '1'> $CGDIR/cpu/users/totem/cgroup.clone_children
echo "800" >   $CGDIR/cpu/users/totem/cpu.shares

mkdir -p $CGDIR/cpuacct/users/totem
mkdir -p $CGDIR/cpuset/users/totem

mkdir -p $CGDIR/memory/users/totem
echo '1'> $CGDIR/memory/users/totem/cgroup.clone_children
echo '1024m' >   $CGDIR/memory/users/totem/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/totem/memory.kmem.tcp.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/totem/memory.limit_in_bytes
echo '1024m' >   $CGDIR/memory/users/totem/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/totem/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/totem
echo '1' > $CGDIR/net_cls/users/totem/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/totem/net_cls.classid

mkdir -p  $CGDIR/pids/users/totem
echo '1' > $CGDIR/pids/users/totem/cgroup.clone_children
echo '32' > $CGDIR/pids/users/totem/pids.max


#######################################################################################

# Wget

mkdir -p $CGDIR/cpu/users/wget
echo '1'> $CGDIR/cpu/users/wget/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/wget/cpu.shares

mkdir -p $CGDIR/cpuacct/users/wget

mkdir -p $CGDIR/cpuset/users/wget


mkdir -p $CGDIR/memory/users/wget
echo '1'> $CGDIR/memory/users/wget/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/wget/memory.soft_limit_in_bytes
echo '256m' > $CGDIR/memory/users/wget/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/wget/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/wget/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/wget/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/wget
echo '1' > $CGDIR/net_cls/users/wget/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/wget/net_cls.classid

mkdir -p  $CGDIR/pids/users/wget
echo '1' > $CGDIR/pids/users/wget/cgroup.clone_children
echo '8' > $CGDIR/pids/users/wget/pids.max

###############################################################################

# Axel

mkdir -p $CGDIR/cpu/users/axel
echo '1'> $CGDIR/cpu/users/axel/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/axel/cpu.shares

mkdir -p $CGDIR/cpuacct/users/axel
mkdir -p $CGDIR/cpuset/users/axel

mkdir -p $CGDIR/memory/users/axel
echo '1'> $CGDIR/memory/users/axel/cgroup.clone_children
echo '32m' >   $CGDIR/memory/users/axel/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/axel/memory.kmem.tcp.limit_in_bytes
echo '32m' >   $CGDIR/memory/users/axel/memory.limit_in_bytes
echo '32m' >   $CGDIR/memory/users/axel/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/axel/memory.oom_control 


mkdir -p $CGDIR/net_cls/users/axel
echo '1' > $CGDIR/net_cls/users/axel/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/axel/net_cls.classid

mkdir -p  $CGDIR/pids/users/axel
echo '1' > $CGDIR/pids/users/axel/cgroup.clone_children
echo '8' > $CGDIR/pids/users/axel/pids.max


######################################################################

# Curl

mkdir -p $CGDIR/cpu/users/curl
echo '1'> $CGDIR/cpu/users/curl/cgroup.clone_children
echo '100' >   $CGDIR/cpu/users/curl/cpu.shares

mkdir -p $CGDIR/cpuacct/users/curl

# echo 250 >   $CGDIR/cpuacct/users/curl/cpuacct.usage

mkdir -p $CGDIR/cpuset/users/curl


mkdir -p $CGDIR/memory/users/curl
echo '1'> $CGDIR/memory/users/curl/cgroup.clone_children
echo '256m' >   $CGDIR/memory/users/curl/memory.soft_limit_in_bytes
echo '256m' > $CGDIR/memory/users/curl/memory.kmem.tcp.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/curl/memory.limit_in_bytes
echo '256m' >   $CGDIR/memory/users/curl/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/users/curl/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/curl
echo '1' > $CGDIR/net_cls/users/curl/cgroup.clone_children
echo '4' > $CGDIR/net_cls/users/curl/net_cls.classid

mkdir -p  $CGDIR/pids/users/curl
echo '1' > $CGDIR/pids/users/curl/cgroup.clone_children
echo '8' > $CGDIR/pids/users/curl/pids.max

#################################################################################33
# Rtmpdump

mkdir -p $CGDIR/cpu/users/rtmpdump
echo '1'> $CGDIR/cpu/users/rtmpdump/cgroup.clone_children
echo 100 >   $CGDIR/cpu/users/rtmpdump/cpu.shares

#mkdir -p $CGDIR/cpuacct/users/tvtime
# echo 100 > $CGDIR/cpuacct/users/tvtime/cpuacct.usage

#mkdir -p $CGDIR/cpuset/users/rtmpdump


mkdir -p $CGDIR/memory/users/rtmpdump
echo '1'> $CGDIR/memory/users/rtmpdump/cgroup.clone_children
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/rtmpdump/memory.kmem.tcp.limit_in_bytes
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.limit_in_bytes
echo '256m' >$CGDIR/memory/users/rtmpdump/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/rtmpdump/memory.oom_control 

mkdir -p $CGDIR/net_cls/users/rtmpdump
echo '1' > $CGDIR/net_cls/users/rtmpdump/cgroup.clone_children
echo '2' > $CGDIR/net_cls/users/rtmpdump/net_cls.classid

###############################################################################
# Xterm

mkdir -p  $CGDIR/blkio/system/xterm
echo '1' > $CGDIR/blkio/system/xterm/cgroup.clone_children
echo '600' > $CGDIR/blkio/system/xterm/blkio.weight

mkdir -p  $CGDIR/cpu/system/xterm
echo '1' > $CGDIR/cpu/system/xterm/cgroup.clone_children
echo '800' > $CGDIR/cpu/system/xterm/cpu.shares

mkdir -p  $CGDIR/memory/system/xterm
echo '1' > $CGDIR/memory/system/xterm/cgroup.clone_children
echo '3g' >   $CGDIR/memory/system/xterm/memory.soft_limit_in_bytes
echo '3g' >   $CGDIR/memory/system/xterm/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/system/xterm/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/system/xterm/memory.oom_control 

mkdir -p  $CGDIR/cpuset/system/xterm
echo -n '1' > $CGDIR/cpuset/system/xterm/cgroup.clone_children

mkdir -p  $CGDIR/pids/system/xterm
echo '1' > $CGDIR/pids/system/xterm/cgroup.clone_children
echo '128' > $CGDIR/pids/system/xterm/pids.max

####################################################################################
# sysmonitor

mkdir -p $CGDIR/cpu/users/sysmonitor
echo '1'> $CGDIR/cpu/users/sysmonitor/cgroup.clone_children
echo 100 >   $CGDIR/cpu/users/sysmonitor/cpu.shares


mkdir -p $CGDIR/memory/users/sysmonitor
echo '1'> $CGDIR/memory/users/sysmonitor/cgroup.clone_children
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.soft_limit_in_bytes
echo '32m' > $CGDIR/memory/users/sysmonitor/memory.kmem.tcp.limit_in_bytes
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.limit_in_bytes
echo '128m' >$CGDIR/memory/users/sysmonitor/memory.memsw.limit_in_bytes
echo '0'   >   $CGDIR/memory/users/sysmonitor/memory.oom_control 

###############################################################################
# Konsola

mkdir -p  $CGDIR/blkio/system/shell
echo '1' > $CGDIR/blkio/system/shell/cgroup.clone_children
echo '600' > $CGDIR/blkio/system/shell/blkio.weight

mkdir -p  $CGDIR/cpu/system/shell
echo '1' > $CGDIR/cpu/system/shell/cgroup.clone_children
echo '800' > $CGDIR/cpu/system/shell/cpu.shares

mkdir -p  $CGDIR/memory/system/shell
echo '1' > $CGDIR/memory/system/shell/cgroup.clone_children
echo '3g' >   $CGDIR/memory/system/shell/memory.soft_limit_in_bytes
echo '3g' >   $CGDIR/memory/system/shell/memory.limit_in_bytes
echo '3g' >   $CGDIR/memory/system/shell/memory.memsw.limit_in_bytes
echo '0'  >   $CGDIR/memory/system/shell/memory.oom_control 

mkdir -p  $CGDIR/cpuset/system/shell
echo -n '1' > $CGDIR/cpuset/system/shell/cgroup.clone_children

mkdir -p  $CGDIR/pids/system/shell
echo '1' > $CGDIR/pids/system/shell/cgroup.clone_children
echo '1024' > $CGDIR/pids/system/shell/pids.max

###############################################################################

for release in `ls $CGDIR/*/*/*/notify_on_release`;
do echo 1 >$release; done;

for clone in `ls $CGDIR/*/*/*/cgroup.clone_children`;
do echo 1 >$clone; done;

for hierarchy in `ls $CGDIR/memory/*/*/memory.use_hierarchy`;
do echo 1 >$hierarchy; done;


echo "Zrobione :)"

Ostatnio edytowany przez Novi-cjusz (2018-07-29 14:48:24)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#20 2018-07-29 14:59:57

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Miałeś go URUCHOMIĆ a nie tutaj wklejać.
I napisać, jeśli pokazują się jakieś błędy.


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#21 2018-07-29 15:03:33

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Zrobilem to dawno powyzej.


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#22 2018-07-29 15:05:46

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Kod:

/usr/local/sbin/cgstart: line 1: !/bin/bash: No such file or directory

COS TY tam wkleił? czy ty w ogóle czytasz, co Ci system ma do powiedzenia?

Wywolanie interpetera języka skryptowego robi się tak:

Kod:

#!/bin/bash

Ostatnio edytowany przez Jacekalex (2018-07-29 15:06:56)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#23 2018-07-29 15:07:21

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Wlasnie to jest bzdura zaraz pokaze Ci widok z ekranu.
https://imgur.com/a/ZkKzQSV

Ostatnio edytowany przez Novi-cjusz (2018-07-29 15:09:39)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

#24 2018-07-29 15:08:35

Jacekalex
Podobno człowiek...;)
Skąd: /dev/urandom
Zarejestrowany: 2008-01-07

Re: Daemon cgroulesngd nie przydziela.

Novi-cjusz napisał(-a):

Wlasnie to jest bzdura zaraz pokaze Ci widok z ekranu.

Nie trzeba widoku z ekranu, popraw PIERWSZĄ LINIĘ, bo tam masz katastrofalny błąd.


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

#25 2018-07-29 15:10:51

Novi-cjusz
Użytkownik
Zarejestrowany: 2013-03-05

Re: Daemon cgroulesngd nie przydziela.

Popatrz na zzut, wczesniej.
Plik jest fizycznie w tej lokalizacji.
Sprawdzalem recznie skrypt "siedzi" = nie rozumiem.
Poprawilem wywolanie.

Kod:

/usr/local/sbin/cgstart
/usr/local/sbin/cgstart: line 26: /sys/fs/cgroup//memory/users/xorg/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 53: /sys/fs/cgroup//memory/users/kde/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 88: /sys/fs/cgroup//memory/users/mate/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 122: /sys/fs/cgroup//memory/users/xfce/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 189: /sys/fs/cgroup//memory/users/chrome/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 225: /sys/fs/cgroup//memory/users/opera/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 256: /sys/fs/cgroup//memory/users/pidgin/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 288: /sys/fs/cgroup//memory/users/kadu/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 320: /sys/fs/cgroup//memory/users/kopete/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 354: /sys/fs/cgroup//memory/users/choqok/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 386: /sys/fs/cgroup//memory/users/linphone/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 419: /sys/fs/cgroup//memory/users/vlc/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 448: /sys/fs/cgroup//memory/users/audacious/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 480: /sys/fs/cgroup//memory/users/thunderbird/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 512: /sys/fs/cgroup//memory/users/fetchmail/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 542: /sys/fs/cgroup//memory/voip/skype/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 577: /sys/fs/cgroup//memory/users/mplayer/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 606: /sys/fs/cgroup//memory/users/minitube/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 636: /sys/fs/cgroup//memory/users/kaffeine/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 667: /sys/fs/cgroup//memory/users/liferea/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 696: /sys/fs/cgroup//memory/users/firefox/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 725: /sys/fs/cgroup//memory/users/akregator/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 758: /sys/fs/cgroup//memory/users/quiterss/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 791: /sys/fs/cgroup//memory/users/totem/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 821: /sys/fs/cgroup//memory/users/wget/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 848: /sys/fs/cgroup//memory/users/axel/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 881: /sys/fs/cgroup//memory/users/curl/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 910: /sys/fs/cgroup//memory/users/rtmpdump/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 932: /sys/fs/cgroup//memory/system/xterm/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 955: /sys/fs/cgroup//memory/users/sysmonitor/memory.memsw.limit_in_bytes: Permission denied
/usr/local/sbin/cgstart: line 973: /sys/fs/cgroup//memory/system/shell/memory.memsw.limit_in_bytes: Permission denied
Zrobione :)

Zrobie restart - zajmie chwile.

Ostatnio edytowany przez Novi-cjusz (2018-07-29 15:15:57)


------------------------------------------------------------------------------------
"Inveniam viam aut faciam" : I will either find a way, or I shall make one
"Złoto to pieniądz królów, srebro to pieniądz dżentelmenów, barter to pieniądz chłopów ale dług to pieniądz niewolników."

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
Możesz wyłączyć AdBlock — tu nie ma reklam ;-)