contrib/docker-git/docker.rc
James Mills 5b115c698f Added docker-git (NEW): Pack, ship and run any application as a lightweight container
--HG--
extra : rebase_source : 72290899350bcddf632b3e03c3356784c961b9a9
2014-02-12 01:24:33 +10:00

35 lines
614 B
Bash
Executable File

#!/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
;;
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