aboutsummaryrefslogtreecommitdiffstats
path: root/testing/docker-registry/docker-registry.initd
blob: 0f0e34fb7d99761f6012e789f1b5db994b183e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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 $?
}