Browse Source

Fix rexray systemd unit

* remove existing rexray containers in ExecStartPre
* set volume tag to rshared
* fix indentation

Closes-Bug: #1686421
Change-Id: I71ffd708baac0403dae7d8f38a073240c44e0434
(cherry picked from commit ad94578a2f)
Mathieu Velten 1 year ago
parent
commit
dacadc2afd
1 changed files with 16 additions and 9 deletions
  1. 16
    9
      magnum/drivers/common/templates/swarm/fragments/volume-service.sh

+ 16
- 9
magnum/drivers/common/templates/swarm/fragments/volume-service.sh View File

@@ -46,16 +46,23 @@ After=docker.service
46 46
 
47 47
 [Service]
48 48
 RemainAfterExit=yes
49
+ExecStartPre=-/usr/bin/docker rm -f rexray
49 50
 ExecStartPre=-/usr/bin/docker pull openstackmagnum/rexray:alpine
50
-ExecStart=/usr/bin/rm -f /var/run/rexray/rexray.pid && \
51
-            /usr/bin/docker run -d --name=rexray --privileged -p 7979:7979 \
52
-                -v /run/docker/plugins:/run/docker/plugins \
53
-                -v /var/lib/rexray:/var/lib/rexray:z \
54
-                -v /var/log/rexray:/var/log/rexray \
55
-                -v /var/run/rexray:/var/run/rexray \
56
-                -v /dev:/dev \
57
-                -v /etc/rexray/config.yml:/etc/rexray/config.yml \
58
-                openstackmagnum/rexray:alpine
51
+ExecStartPre=-/usr/bin/rm -f /var/run/rexray/rexray.pid
52
+ExecStart=/usr/bin/docker run -d --name=rexray --privileged \\
53
+--pid host \\
54
+--net host \\
55
+-p 7979:7979 \\
56
+-v /run/docker/plugins:/run/docker/plugins \\
57
+-v /var/lib/rexray:/var/lib/rexray:Z \\
58
+-v /var/lib/libstorage:/var/lib/libstorage:rshared \\
59
+-v /var/log/rexray:/var/log/rexray \\
60
+-v /var/run/rexray:/var/run/rexray \\
61
+-v /var/lib/docker:/var/lib/docker:rshared \\
62
+-v /var/run/docker:/var/run/docker \\
63
+-v /dev:/dev \\
64
+-v /etc/rexray/config.yml:/etc/rexray/config.yml \\
65
+openstackmagnum/rexray:alpine
59 66
 ExecStop=/usr/bin/docker stop rexray
60 67
 
61 68
 [Install]

Loading…
Cancel
Save