#!/sbin/openrc-run # $Header: $ DOCKER_REGISTRY_LOGFILE=${DOCKER_REGISTRY_LOGFILE:-/var/log/${SVCNAME}.log} DOCKER_REGISTRY_PIDFILE=${DOCKER_REGISTRY_PIDFILE:-/run/${SVCNAME}.pid} DOCKER_REGISTRY_BINARY=${DOCKER_REGISTRY_BINARY:-/usr/bin/docker-registry} DOCKER_REGISTRY_CONFIG=${DOCKER_REGISTRY_CONFIG:-/etc/docker-registry/config.yml} start() { checkpath -f -m 0644 -o root:docker "$DOCKER_REGISTRY_LOGFILE" ebegin "Starting docker registry" start-stop-daemon --start --background \ --exec "$DOCKER_REGISTRY_BINARY" \ --pidfile "$DOCKER_PIDFILE" \ --make-pid \ --background \ --stdout "$DOCKER_LOGFILE" \ --stderr "$DOCKER_LOGFILE" \ -- "$DOCKER_REGISTRY_CONFIG" eend $? } stop() { ebegin "Stopping docker daemon" start-stop-daemon --stop \ --exec "$DOCKER_BINARY" \ --pidfile "$DOCKER_PIDFILE" eend $? }