Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 578 Bytes
[Unit]
Description=MariaDB with Galera Cluster
Requires=docker.service
Wants=network-online.target
After=docker.service network-online.target
[Service]
Restart=always
RestartSec=3
TimeoutStartSec=0
ExecStartPre=/usr/bin/chmod +x /opt/bin/docker-mariadb-galera.sh
ExecStart=/opt/bin/docker-mariadb-galera.sh
ExecStop=/bin/bash -c " \
HOSTNAME=$(/bin/hostname) \
HOSTNUM=$(/bin/expr $HOSTNAME : '.*\\([0-9]\\)') \
/usr/bin/docker stop mariadb-container-$HOSTNUM || true \
/usr/bin/docker rm mariadb-container-$HOSTNUM || true \
"
[Install]
WantedBy=multi-user.target