summaryrefslogtreecommitdiff
path: root/rc.redis/redis/run
blob: 8c8a426ac5eb4d81ab4b31cae68b87529be92451 (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
#!/bin/execlineb -P

###########################################################################
# Start redis instance supervisor                                         #
#                                                                         #
# The redis instances are run by the redis user. Database directory is    #
# owned by that user and the redis group. You can create these with:      #
#                                                                         #
#   groupadd -g 121 redis                                                 #
#   useradd -u 121 -g 121 -d /var/lib/redis -s /sbin/nologin redis        #
#                                                                         #
# The configuration for redis instances is expected to be named same as   #
# port the instance will be running on. For example if redis should       #
# listen on 6379, there should be a configuration file in                 #
# /etc/redis/6379.conf. Generic settings can be put in                    #
# /etc/redis/redis.conf and included in other configurations. s6 instance #
# name should be the port number as well, 6379 in this case.              #
###########################################################################

fdmove -c 2 1
foreground { chown redis:redis /var/lib/redis }
s6-envdir env
multisubstitute {
  importas -u CMD CMD
  importas -usCd" " CMD_OPTS CMD_OPTS
}
emptyenv -p $CMD $CMD_OPTS -- instance