github.com/fcwu/docker@v1.4.2-0.20150115145920-2a69ca89f0df/contrib/init/openrc/docker.initd (about) 1 #!/sbin/runscript 2 # Copyright 1999-2013 Gentoo Foundation 3 # Distributed under the terms of the GNU General Public License v2 4 # $Header: $ 5 6 DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log} 7 DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid} 8 DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker} 9 DOCKER_OPTS=${DOCKER_OPTS:-} 10 11 start() { 12 checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE" 13 14 ulimit -n 1048576 15 ulimit -u 1048576 16 17 ebegin "Starting docker daemon" 18 start-stop-daemon --start --background \ 19 --exec "$DOCKER_BINARY" \ 20 --pidfile "$DOCKER_PIDFILE" \ 21 --stdout "$DOCKER_LOGFILE" \ 22 --stderr "$DOCKER_LOGFILE" \ 23 -- -d -p "$DOCKER_PIDFILE" \ 24 $DOCKER_OPTS 25 eend $? 26 } 27 28 stop() { 29 ebegin "Stopping docker daemon" 30 start-stop-daemon --stop \ 31 --exec "$DOCKER_BINARY" \ 32 --pidfile "$DOCKER_PIDFILE" 33 eend $? 34 }