2014-02-12 01:24:08 +10:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# /etc/rc.d/docker: start/stop docker daemon
|
|
|
|
#
|
|
|
|
|
|
|
|
source /etc/docker.conf
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
start)
|
2014-03-11 10:13:27 +10:00
|
|
|
# Ensure ownership and permissiong of log file.
|
|
|
|
touch /var/log/docker.log
|
|
|
|
chgrp docker /var/log/docker.log
|
|
|
|
chown 640 /var/log/docker.log
|
|
|
|
|
2014-03-17 14:11:03 +10:00
|
|
|
# Ensure cgroups is properly mounted.
|
|
|
|
cgroupfs-mount
|
2014-03-11 10:13:27 +10:00
|
|
|
|
|
|
|
nohup /usr/bin/docker $DOCKER_OPTS > /var/log/docker.log 2>&1 &
|
2014-02-12 01:24:08 +10:00
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
if [ -f /var/run/docker.pid ]; then
|
|
|
|
kill $(< /var/run/docker.pid)
|
|
|
|
rm -f /var/run/docker.pid
|
|
|
|
rm -f /var/run/docker.sock
|
|
|
|
else
|
|
|
|
killall -q /usr/bin/docker
|
|
|
|
rm -f /var/run/docker.sock
|
|
|
|
fi
|
2014-03-17 14:11:03 +10:00
|
|
|
|
|
|
|
# Unmount cgroups is
|
2014-03-17 14:31:12 +10:00
|
|
|
cgroupfs-umount
|
2014-02-12 01:24:08 +10:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 2
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 [start|stop|restart]"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End of file
|