3 # Create lightweight, portable, self-sufficient containers.
7 # description: Docker is an open-source project to easily create lightweight, portable, \
8 # self-sufficient containers from any application. The same container that a \
9 # developer builds and tests on a laptop can run at scale, in production, on \
10 # VMs, bare metal, OpenStack clusters, public clouds and more. \
12 # pidfile: /var/run/docker.pid
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "Docker"
31 # Get service config - may override defaults
32 [ -f /etc/sysconfig/docker ] && . /etc/sysconfig/docker
34 pidfile="/var/run/docker.pid"
37 # Check if the service is already running?
38 if [ -f /var/lock/subsys/docker ]; then
39 msg_already_running "Docker"
44 daemon --fork /usr/bin/docker -d
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/docker
50 if [ ! -f /var/lock/subsys/docker ]; then
51 msg_not_running "Docker"
57 killproc --pidfile $pidfile docker
58 rm -f /var/lock/subsys/docker
62 if [ ! -f /var/lock/subsys/docker ]; then
63 msg_not_running "Docker"
73 # See how we were called.
92 status --pidfile $pidfile docker docker
96 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"