aboutsummaryrefslogtreecommitdiffstats
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
parenta6c484ebf934b04b9fdeb98fd3923bfb53549e05 (diff)
downloadaports-c2a7d0f51f18b1b3820d9515ecf744573b04c620.tar.bz2
aports-c2a7d0f51f18b1b3820d9515ecf744573b04c620.tar.xz
community/docker-registry: improve runscript
-rw-r--r--community/docker-registry/APKBUILD6
-rw-r--r--community/docker-registry/docker-registry.initd33
2 files changed, 21 insertions, 18 deletions
diff --git a/community/docker-registry/APKBUILD b/community/docker-registry/APKBUILD
index d67ac5917d..df263c4560 100644
--- a/community/docker-registry/APKBUILD
+++ b/community/docker-registry/APKBUILD
@@ -45,9 +45,5 @@ package() {
"$pkgdir"/etc/init.d/$pkgname
}
-md5sums="97f16e2b738b1953c5b62a2275f967be docker-registry-2.5.1.tar.gz
-eaa66ce1509f0b2f257e2919b350fc46 docker-registry.initd"
-sha256sums="d98ebca3518c17d95468b1d40b87861036001301a16a50563203e4b9af72c514 docker-registry-2.5.1.tar.gz
-d35bfa20956a4dbd6070799fa8a1fd34c100070672e24c9b759df23c69b5431a docker-registry.initd"
sha512sums="5217e2ca361d71806c8ec4da1cf1c2c5dc4160b84c2a98feae50872342d0acf116768a3acf00769bafd66e73c9922c7fe97cbde51955d8aa1d1ed914de2e3d34 docker-registry-2.5.1.tar.gz
-338d78b6813825154673c50cd73884297ebdd8c497ec933048dc5bf0863136e7bc308860ce71835d7e48a2b950266a69e60d318e382b18f8352d6c662851ed09 docker-registry.initd"
+8f1d0c9d2558fe89158a9766a2357d667269d6992a01f87e81a92a5079cff3810e5a8933b8506c0265c3fd6d97aecbb863370fb778717fe7d5d49b9f9c4faaeb docker-registry.initd"
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"
}