summaryrefslogtreecommitdiff
path: root/docker/docker.rc
blob: bfd10b774b9ae0278cdce60da058a35180388dd3 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/docker: start/stop docker daemon
    4 #
    5 
    6 source /etc/docker.conf
    7 
    8 case $1 in
    9 start)
   10     nohup /usr/bin/docker $DOCKER_OPTS &> /var/log/docker.log &
   11     touch /var/run/docker.sock
   12     chgrp docker /var/run/docker.sock
   13     chmod 660 /var/run/docker.sock
   14     ;;
   15 stop)
   16     if [ -f /var/run/docker.pid ]; then
   17         kill $(< /var/run/docker.pid)
   18         rm -f /var/run/docker.pid
   19         rm -f /var/run/docker.sock
   20     else
   21         killall -q /usr/bin/docker
   22         rm -f /var/run/docker.sock
   23     fi
   24     ;;
   25 restart)
   26     $0 stop
   27     sleep 2
   28     $0 start
   29     ;;
   30 *)
   31     echo "usage: $0 [start|stop|restart]"
   32     ;;
   33 esac
   34 
   35 # End of file

Generated by cgit