25 lines
408 B
Plaintext
Raw Normal View History

2018-01-19 15:50:15 +01:00
#!/sbin/openrc-run
description="MariaDB docker container"
depend() {
need docker
2018-01-19 15:50:15 +01:00
}
start() {
/usr/bin/docker run -d --rm \
--name mariadb \
-h mariadb \
2018-01-27 14:13:59 +01:00
-v /srv/mariadb/conf:/etc/mysql \
-v /srv/mariadb/data:/var/lib/mysql \
mariadb
2018-01-19 15:50:15 +01:00
}
start_post() {
2018-07-16 09:33:08 +02:00
timeout -t 60 docker exec mariadb sh -c 'until [ -e /run/mysqld/mysqld.sock ]; do usleep 50000; done'
}
2018-01-19 15:50:15 +01:00
stop() {
2018-01-19 16:02:41 +01:00
/usr/bin/docker stop mariadb
2018-01-19 15:50:15 +01:00
}