Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/etc/init/cgmanager.conf
description "cgroup management daemon"
author "Serge Hallyn <serge.hallyn@ubuntu.com>"
respawn
# in trusty /sys/fs/cgroup will be mounted for us.
# prior to saucy, we would need to start on mounted
# MOUNTPOINT=/sys, and mount /sys/fs/cgroup ourselves
start on mounted MOUNTPOINT=/sys/fs/cgroup
script
test -x /sbin/cgmanager || { stop; exit 0; }
# check whether we should start a cgproxy or a cgmanager
tostart=/sbin/cgproxy
dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.ping int32:0 > /dev/null 2>&1 || tostart=/sbin/cgmanager
exec $tostart
end script
post-stop script
rm /sys/fs/cgroup/cgmanager/sock || true
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.