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)
|
|
|
|
nohup /usr/bin/docker $DOCKER_OPTS &> /var/log/docker.log &
|
|
|
|
touch /var/run/docker.sock
|
|
|
|
chgrp docker /var/run/docker.sock
|
2014-02-28 00:27:10 +10:00
|
|
|
chmod 660 /var/run/docker.sock
|
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
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 2
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 [start|stop|restart]"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End of file
|