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 "LXC Docker"
31 # Get service config - may override defaults
32 [ -f /etc/sysconfig/lxc-docker ] && . /etc/sysconfig/lxc-docker
34 pidfile="/var/run/docker.pid"
37 # Check if the service is already running?
38 if [ -f /var/lock/subsys/lxc-docker ]; then
39 msg_already_running "LXC Docker"
43 msg_starting "LXC Docker"
44 daemon --fork /usr/bin/docker -d
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lxc-docker
50 if [ ! -f /var/lock/subsys/lxc-docker ]; then
51 msg_not_running "LXC Docker"
56 msg_stopping "LXC Docker"
57 killproc --pidfile $pidfile docker -TERM
58 rm -f /var/lock/subsys/lxc-docker
62 if [ ! -f /var/lock/subsys/lxc-docker ]; then
63 msg_not_running "LXC Docker"
73 # See how we were called.
92 status --pidfile $pidfile lxc-docker docker
96 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"