Add templated redis
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/execlineb -P
|
||||
|
||||
redirfd -w 2 /dev/null
|
||||
getcwd -E CWD
|
||||
backtick -E port { basename $CWD }
|
||||
backtick -En PING { redis-cli -p $port ping }
|
||||
eltest $PING = PONG
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
redis-server
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/etc/redis/${port}.conf
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
s6-log
|
||||
+1
@@ -0,0 +1 @@
|
||||
-d3
|
||||
@@ -0,0 +1,2 @@
|
||||
root
|
||||
# Logging directory group ownership
|
||||
@@ -0,0 +1,2 @@
|
||||
root
|
||||
# Logging directory owner
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/var/log/redis/${port}
|
||||
# Logging directory path
|
||||
@@ -0,0 +1,2 @@
|
||||
750
|
||||
# Logging directory access rights in octal
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
n4 s500000 T $LOGDIR_PATH
|
||||
# Logging script used by s6-log
|
||||
@@ -0,0 +1 @@
|
||||
3
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/execlineb -WS1
|
||||
|
||||
###############################################
|
||||
# Start a logging daemon for the redis daemon #
|
||||
###############################################
|
||||
|
||||
s6-envdir env
|
||||
multisubstitute {
|
||||
importas -iu LOGDIR_OWNER LOGDIR_OWNER
|
||||
importas -iu LOGDIR_GROUP LOGDIR_GROUP
|
||||
importas -iu LOGDIR_PERMS LOGDIR_PERMS
|
||||
importas -iu CMD CMD
|
||||
importas -usCd" " CMD_OPTS CMD_OPTS
|
||||
importas -iusCd" " LOG_SCRIPT LOG_SCRIPT
|
||||
}
|
||||
s6-envuidgid -Bi ${LOGDIR_OWNER}:${LOGDIR_GROUP}
|
||||
multisubstitute {
|
||||
importas -iu LOGDIR_PATH LOGDIR_PATH
|
||||
importas -iu UID UID
|
||||
importas -iu GID GID
|
||||
}
|
||||
backtick -E port { dirname $1 }
|
||||
if { install -dm $LOGDIR_PERMS -o $UID -g $GID $LOGDIR_PATH }
|
||||
s6-setuidgid ${UID}:${GID}
|
||||
exec -c $CMD $CMD_OPTS -- $LOG_SCRIPT
|
||||
@@ -0,0 +1 @@
|
||||
longrun
|
||||
@@ -0,0 +1 @@
|
||||
3
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/execlineb -WS1
|
||||
|
||||
#################################
|
||||
# Start redis (key-value store) #
|
||||
#################################
|
||||
|
||||
fdmove -c 2 1
|
||||
s6-envdir env
|
||||
multisubstitute {
|
||||
importas -iu CMD CMD
|
||||
importas -usCd" " CMD_OPTS CMD_OPTS
|
||||
}
|
||||
prlimit --nofile=8192
|
||||
define port $1
|
||||
s6-notifyoncheck -d
|
||||
s6-setuidgid redis
|
||||
exec -c $CMD $CMD_OPTS
|
||||
@@ -0,0 +1 @@
|
||||
longrun
|
||||
Reference in New Issue
Block a user