aboutsummaryrefslogtreecommitdiffstats
path: root/main/redis/redis.post-install
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-07-30 19:17:26 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-07-30 19:19:48 +0200
commitea95115b072ce66d1354d5908493e83101f44f4f (patch)
treed5e5a1d1cb9c04ff95afbc54c752ada57a01766a /main/redis/redis.post-install
parentc1c8c5a78a149b9954517df485d61e66a73a93a4 (diff)
downloadaports-ea95115b072ce66d1354d5908493e83101f44f4f.tar.bz2
aports-ea95115b072ce66d1354d5908493e83101f44f4f.tar.xz
main/redis: create /run/redis if OpenRC is not present
Fixes 9146 <https://bugs.alpinelinux.org/issues/9146> Fixes 9113 <https://bugs.alpinelinux.org/issues/9113>
Diffstat (limited to 'main/redis/redis.post-install')
-rw-r--r--main/redis/redis.post-install11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/redis/redis.post-install b/main/redis/redis.post-install
new file mode 100644
index 0000000000..a0cfbe51ee
--- /dev/null
+++ b/main/redis/redis.post-install
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Create directory for the socket if OpenRC is not present (e.g. in container).
+# It's conditioned using post-install script specifically to avoid easily
+# overlookable mistakes in the init script (service working until the
+# first restart).
+if ! [ -e /sbin/openrc ]; then
+ install -d -m 755 -o redis -g redis /run/redis
+fi
+
+exit 0