golang, docker in main iproute2 verbump

This commit is contained in:
Ertuğrul Erata
2015-07-20 21:58:40 +03:00
parent a73ae62ef9
commit 1df4491df4
17 changed files with 527 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
#!/bin/sh
# Copyright 2011 Canonical, Inc
# 2014 Tianon Gravi
# Author: Serge Hallyn <serge.hallyn@canonical.com>
# Tianon Gravi <admwiggin@gmail.com>
set -e
# for simplicity this script provides no flexibility
# if cgroup is mounted by fstab, don't run
# don't get too smart - bail on any uncommented entry with 'cgroup' in it
if grep -v '^#' /etc/fstab | grep -q cgroup; then
echo 'cgroups mounted from fstab, not mounting /sys/fs/cgroup'
exit 0
fi
# kernel provides cgroups?
if [ ! -e /proc/cgroups ]; then
exit 0
fi
# if we don't even have the directory we need, something else must be wrong
if [ ! -d /sys/fs/cgroup ]; then
exit 0
fi
# mount /sys/fs/cgroup if not already done
if ! mountpoint -q /sys/fs/cgroup; then
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
fi
cd /sys/fs/cgroup
# get/mount list of enabled cgroup controllers
for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
mkdir -p $sys
if ! mountpoint -q $sys; then
if ! mount -n -t cgroup -o $sys cgroup $sys; then
rmdir $sys || true
fi
fi
done
# example /proc/cgroups:
# #subsys_name hierarchy num_cgroups enabled
# cpuset 2 3 1
# cpu 3 3 1
# cpuacct 4 3 1
# memory 5 3 0
# devices 6 3 1
# freezer 7 3 1
# blkio 8 3 1
exit 0
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
# Copyright 2011 Canonical, Inc
# 2014 Tianon Gravi
# Author: Serge Hallyn <serge.hallyn@canonical.com>
# Tianon Gravi <admwiggin@gmail.com>
set -e
# we don't care to move tasks around gratuitously - just umount the cgroups
# if we don't even have the directory we need, something else must be wrong
if [ ! -d /sys/fs/cgroup ]; then
exit 0
fi
# if /sys/fs/cgroup is not mounted, we don't bother
if ! mountpoint -q /sys/fs/cgroup; then
exit 0
fi
cd /sys/fs/cgroup
for sys in *; do
if mountpoint -q $sys; then
umount $sys
fi
if [ -d $sys ]; then
rmdir $sys || true
fi
done
exit 0
@@ -0,0 +1,13 @@
# /etc/conf.d/docker: config file for /etc/init.d/docker
# where the docker daemon output gets piped
DOCKER_LOGFILE="/var/log/docker.log"
# where docker's pid get stored
DOCKER_PIDFILE="/var/run/docker.pid"
# where the docker daemon itself is run from
DOCKER_BINARY="/usr/bin/docker"
# any other random options you want to pass to docker
DOCKER_OPTS=""