Permalink
Browse files

Mount cgroup mounts in /tmp/warden

  • Loading branch information...
1 parent 9136042 commit c8bb68f91d763bd79a4d75482f0ad504131065d7 Dmitriy Kalinin and Pieter Noordhuis committed Mar 15, 2013
@@ -11,7 +11,7 @@ module Features
module Cgroup
def cgroup_path(subsystem)
- File.join("/sys/fs/cgroup", subsystem.to_s, "instance-#{self.container_id}")
+ File.join("/tmp/warden/cgroup", subsystem.to_s, "instance-#{self.container_id}")
end
def do_info(request, response)
@@ -18,15 +18,14 @@ then
rmdir /dev/cgroup
fi
-cgroup_path=/sys/fs/cgroup
+cgroup_path=/tmp/warden/cgroup
if [ ! -d $cgroup_path ]
then
echo "$cgroup_path does not exist..."
exit 1
fi
-# Check if /sys/fs/cgroup is mounted with a cgroup mount, and umount if so
if grep "${cgroup_path} " /proc/mounts | cut -d' ' -f3 | grep -q cgroup
then
find $cgroup_path -mindepth 1 -type d | sort | tac | xargs rmdir
@@ -14,7 +14,7 @@ source ./etc/config
if [ -f ./run/wshd.pid ]
then
pid=$(cat ./run/wshd.pid)
- path=/sys/fs/cgroup/cpu/instance-$id
+ path=/tmp/warden/cgroup/cpu/instance-$id
tasks=$path/tasks
if [ -d $path ]
@@ -37,7 +37,7 @@ then
rm -f ./run/wshd.pid
# Remove cgroups
- for system_path in /sys/fs/cgroup/*
+ for system_path in /tmp/warden/cgroup/*
do
path=$system_path/instance-$id
@@ -10,7 +10,7 @@ cd $(dirname $0)/../
source ./lib/common.sh
# Add new group for every subsystem
-for system_path in /sys/fs/cgroup/*
+for system_path in /tmp/warden/cgroup/*
do
instance_path=$system_path/instance-$id
@@ -199,7 +199,7 @@ def trigger_oom
describe "setting limits" do
def integer_from_memory_cgroup(file)
- File.read(File.join("/sys/fs/cgroup/memory", "instance-#{@handle}", file)).to_i
+ File.read(File.join("/tmp/warden/cgroup/memory", "instance-#{@handle}", file)).to_i
end
let(:hundred_mb) { 100 * 1024 * 1024 }

0 comments on commit c8bb68f

Please sign in to comment.