25 lines
407 B
Plaintext
Executable File
25 lines
407 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
description="MariaDB docker container"
|
|
|
|
depend() {
|
|
need docker
|
|
}
|
|
|
|
start() {
|
|
/usr/bin/docker run -d --rm \
|
|
--name mariadb \
|
|
-h mariadb \
|
|
-v /srv/mariadb/conf:/etc/mysql \
|
|
-v /srv/mariadb/data:/var/lib/mysql \
|
|
mariadb
|
|
}
|
|
|
|
start_post() {
|
|
timeout -t 3 docker exec mariadb sh -c 'until [ -e /run/mysqld/mysqld.sock ]; do usleep 50000; done'
|
|
}
|
|
|
|
stop() {
|
|
/usr/bin/docker stop mariadb
|
|
}
|