aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker-registry/docker-registry.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-02-25 14:09:24 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-02-25 14:10:39 +0100
commitc2a7d0f51f18b1b3820d9515ecf744573b04c620 (patch)
treebb1ec336ce327e357eea6d8d8651750d8f17a6ce /community/docker-registry/docker-registry.initd
parenta6c484ebf934b04b9fdeb98fd3923bfb53549e05 (diff)
downloadaports-c2a7d0f51f18b1b3820d9515ecf744573b04c620.tar.bz2
aports-c2a7d0f51f18b1b3820d9515ecf744573b04c620.tar.xz
community/docker-registry: improve runscript
Diffstat (limited to 'community/docker-registry/docker-registry.initd')
-rw-r--r--community/docker-registry/docker-registry.initd33
1 files changed, 20 insertions, 13 deletions
diff --git a/community/docker-registry/docker-registry.initd b/community/docker-registry/docker-registry.initd
index 47064077ed..bae96e948c 100644
--- a/community/docker-registry/docker-registry.initd
+++ b/community/docker-registry/docker-registry.initd
@@ -1,20 +1,27 @@
#!/sbin/openrc-run
-# $Header: $
-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}
-DOCKER_REGISTRY_LOGFILE=${DOCKER_REGISTRY_LOGFILE:-/var/log/docker-registry.log}
+# These awfully long uppercase variables are here only for backward
+# compatibility. Do not use them!
+: ${logfile:=${DOCKER_REGISTRY_LOGFILE:-"/var/log/docker-registry.log"}}
+: ${conffile:=${DOCKER_REGISTRY_CONFIG:-"/etc/docker-registry/config.yml"}}
+: ${user:="docker-registry"}
+: ${group:="$user"}
-command="$DOCKER_REGISTRY_BINARY"
-command_args="$DOCKER_REGISTRY_CONFIG"
-pidfile="$DOCKER_REGISTRY_PIDFILE"
-command_background="true"
-start_stop_daemon_args="--user docker-registry:docker-registry --stdout $DOCKER_REGISTRY_LOGFILE --stderr $DOCKER_REGISTRY_LOGFILE"
name="Docker Registry"
-start_pre() {
- checkpath --directory --owner docker-registry:docker-registry --mode 0770 /var/lib/registry
+command="/usr/bin/docker-registry"
+command_args="$conffile"
+command_background="yes"
+
+pidfile="/run/$RC_SVCNAME.pid"
+start_stop_daemon_args="
+ --user $user:$group
+ --stdout $logfile
+ --stderr $logfile"
- checkpath -f -m 0644 -o docker-registry:docker-registry "$DOCKER_REGISTRY_LOGFILE"
+required_files="$conffile"
+
+start_pre() {
+ checkpath -d -m 0770 -o "$user:$group" /var/lib/registry
+ checkpath -f -m 0644 -o "$user:$group" "$logfile"
}