Browse Source

Ajout service redis slave

Teddy Cornaut 1 month ago
parent
commit
1ca2797bb3
2 changed files with 46 additions and 1 deletions
  1. 1
    1
      dicos/90_redis.xml
  2. 45
    0
      init/redis2-server.service

+ 1
- 1
dicos/90_redis.xml View File

@@ -6,7 +6,7 @@
6 6
         <file filelist='redisSlave' name='/etc/redis/redis-slave.conf' mkdir='True' rm='True'/>
7 7
         <file filelist='redisCl' name='/etc/redis/cluster.conf' source='redis-cluster.conf' mkdir='True' rm='True'/>
8 8
         <service servicelist="svredis">redis-server</service>
9
-        <!--service servicelist="svredisSlave">redis2-server</service -->
9
+        <service servicelist="svredisSlave">redis2-server</service>
10 10
         <service_access service='redis-server'>
11 11
             <port service_accesslist='saRedis' protocol='tcp' port_type='SymLinkOption'>redisPort</port>
12 12
             <port service_accesslist='saRedis' protocol='tcp' port_type='SymLinkOption'>redisClPort</port>

+ 45
- 0
init/redis2-server.service View File

@@ -0,0 +1,45 @@
1
+[Unit]
2
+Description=Advanced key-value store instance 2
3
+After=network.target
4
+Documentation=http://redis.io/documentation, man:redis-server(1)
5
+
6
+[Service]
7
+Type=forking
8
+ExecStart=/usr/bin/redis-server /etc/redis/redis-slave.conf
9
+PIDFile=/var/run/redis/redis-slave-server.pid
10
+TimeoutStopSec=0
11
+Restart=always
12
+User=redis
13
+Group=redis
14
+RuntimeDirectory=redis
15
+RuntimeDirectoryMode=2755
16
+
17
+UMask=007
18
+PrivateTmp=yes
19
+LimitNOFILE=65535
20
+PrivateDevices=yes
21
+ProtectHome=yes
22
+ReadOnlyDirectories=/
23
+ReadWriteDirectories=-/var/lib/redis
24
+ReadWriteDirectories=-/var/log/redis
25
+ReadWriteDirectories=-/var/run/redis
26
+
27
+NoNewPrivileges=true
28
+CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
29
+MemoryDenyWriteExecute=true
30
+ProtectKernelModules=true
31
+ProtectKernelTunables=true
32
+ProtectControlGroups=true
33
+RestrictRealtime=true
34
+RestrictNamespaces=true
35
+RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
36
+
37
+# redis-server can write to its own config file when in cluster mode so we
38
+# permit writing there by default. If you are not using this feature, it is
39
+# recommended that you replace the following lines with "ProtectSystem=full".
40
+ProtectSystem=true
41
+ReadWriteDirectories=-/etc/redis
42
+
43
+[Install]
44
+WantedBy=multi-user.target
45
+Alias=redis2.service