2013-10-15 11:37:18 -04:00
|
|
|
description "Docker daemon"
|
|
|
|
|
2014-05-24 11:04:57 -04:00
|
|
|
start on (local-filesystems and net-device-up IFACE!=lo)
|
2013-10-15 11:37:18 -04:00
|
|
|
stop on runlevel [!2345]
|
2014-03-18 16:26:21 -04:00
|
|
|
limit nofile 524288 1048576
|
|
|
|
limit nproc 524288 1048576
|
2013-10-15 11:37:18 -04:00
|
|
|
|
|
|
|
respawn
|
|
|
|
|
2014-03-11 03:21:59 -04:00
|
|
|
pre-start script
|
|
|
|
# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
|
|
|
|
if grep -v '^#' /etc/fstab | grep -q cgroup \
|
|
|
|
|| [ ! -e /proc/cgroups ] \
|
|
|
|
|| [ ! -d /sys/fs/cgroup ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
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
|
|
|
|
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
|
|
|
|
)
|
|
|
|
end script
|
|
|
|
|
2013-10-15 11:37:18 -04:00
|
|
|
script
|
2014-03-10 01:16:42 -04:00
|
|
|
# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
|
2013-11-11 13:13:16 -05:00
|
|
|
DOCKER=/usr/bin/$UPSTART_JOB
|
|
|
|
DOCKER_OPTS=
|
|
|
|
if [ -f /etc/default/$UPSTART_JOB ]; then
|
|
|
|
. /etc/default/$UPSTART_JOB
|
|
|
|
fi
|
2014-03-27 13:44:33 -04:00
|
|
|
exec "$DOCKER" -d $DOCKER_OPTS
|
2013-10-15 11:37:18 -04:00
|
|
|
end script
|