clean up docker init

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-03-04 11:50:28 +00:00
parent e9216cc716
commit e003a56326

View File

@ -1,11 +1,17 @@
#!/sbin/openrc-run #!/sbin/openrc-run
depend()
{
after 9pudc transfused
before chronyd
}
start()
{
export DOCKER_RAMDISK="true" export DOCKER_RAMDISK="true"
command="${DOCKER_BINARY:-/usr/bin/docker}" command="${DOCKER_BINARY:-/usr/bin/docker}"
pidfile="/run/docker.pid"
# Start with networking on both Mac and Hyper-V, but in # Start with networking on both Mac and Hyper-V, but in
# future change this to use a hypervisor socket. # future change this to use a hypervisor socket.
DOCKER_OPTS="${DOCKER_OPTS} -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock" DOCKER_OPTS="${DOCKER_OPTS} -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
@ -26,19 +32,22 @@ command_args="daemon -p \"${pidfile}\" ${DOCKER_OPTS}"
DOCKER_LOGFILE="/var/log/docker.log" DOCKER_LOGFILE="/var/log/docker.log"
start_stop_daemon_args="--background \ pidfile="/run/docker.pid"
--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
depend() start-stop-daemon --start --quiet \
{ --background \
after 9pudc transfused --exec ${command} \
before chronyd --pidfile ${pidfile} \
--stderr "${DOCKER_LOGFILE}" \
--stdout "${DOCKER_LOGFILE}" \
-- ${command_args}
} }
stop() stop()
{ {
# stop docker # stop docker
einfo "Stopping docker" einfo "Stopping docker"
pidfile="/run/docker.pid"
start-stop-daemon --stop --quiet --pidfile ${pidfile} start-stop-daemon --stop --quiet --pidfile ${pidfile}
# taken from localmount stop script # taken from localmount stop script