diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-05-09 21:09:43 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-05-09 21:39:09 +0200 |
commit | d8ea14ea1b5eea168b9b0bb0399aa8585facb8ec (patch) | |
tree | 28b3ec9e27e49e19eb9ee5ccbfd142013a09e008 /main/mariadb | |
parent | f41fee8fe71a7a541f0558c4427149c563696c2e (diff) | |
download | aports-d8ea14ea1b5eea168b9b0bb0399aa8585facb8ec.tar.bz2 aports-d8ea14ea1b5eea168b9b0bb0399aa8585facb8ec.tar.xz |
main/mariadb: reformat init script
Diffstat (limited to 'main/mariadb')
-rw-r--r-- | main/mariadb/APKBUILD | 2 | ||||
-rw-r--r-- | main/mariadb/mariadb.initd | 25 |
2 files changed, 14 insertions, 13 deletions
diff --git a/main/mariadb/APKBUILD b/main/mariadb/APKBUILD index 6b74a9f00f..e2069a1b8f 100644 --- a/main/mariadb/APKBUILD +++ b/main/mariadb/APKBUILD @@ -422,7 +422,7 @@ _plugin_rocksdb() { } sha512sums="3cbd93291aa43b235e5b81d953ea69fb32df54fb518f922f69b5485952f01fae693c77b0efac37f414ed7ff132d3b58f899812bdb7be8a5b344c3640e2c3a0dd mariadb-10.3.13.tar.gz -b142b965ee2e02242f013f6b36444729b55f646ced4590989221788fe7adafc0d87b8856e4df94fba972de57aa47d4592958b302b99681b771818c6e398d1332 mariadb.initd +eb9a0b781165975c96eb0cfc0e8544b10cdee7e8a731b4c3c51c1758e6336babe65fa5bec159fd8c49de52d0564e8240aa8bdd27062c4ecf0d09ed3e052df4d5 mariadb.initd b4469f2f0299e71c09b65c91373f2d72b7fe9a9cd58ad24737a78a8097473b29c32b7267e173a2dfe1158f2f7d40a7fb02fb1b35caeda44d16ae3b9e2602a75f fix-c11-atomics-check.patch e9ae4613f1d8c5f0a59b39a3548c46e50674ae78e7457d0e64c49f7e1573125c13634bbce7e29179bb8865a423171f852f43b96f7ef95619a95f02edcfc71efd ppc-remove-glibc-dep.patch 70da971aa78815495098205bcbd28428430aa83c3f1050fec0231ca86af9d9def2d2108a48ee08d86812c8dc5ad8ab1ef4e17a49b4936ed5187ae0f6a7ef8f63 pcre.cmake.patch" diff --git a/main/mariadb/mariadb.initd b/main/mariadb/mariadb.initd index 35906a3a8c..fb0c89a9e9 100644 --- a/main/mariadb/mariadb.initd +++ b/main/mariadb/mariadb.initd @@ -1,29 +1,20 @@ #!/sbin/openrc-run - -getconf() { - v=$(my_print_defaults --mysqld | grep ^--$1) - [ -z $v ] && echo $2 || echo ${v#*=} -} +extra_stopped_commands="setup" retry="60" -extra_stopped_commands="setup" command="/usr/bin/mysqld_safe" command_args="--syslog --nowatch" + depend() { use net need localmount } -setup() { - ebegin "Creating a new MySQL database" - mysql_install_db --user=mysql --datadir=/var/lib/mysql - eend $? -} - start_pre() { pidfile=$(getconf pid-file "/run/mysqld/mysqld.pid") command_args="$command_args --pid-file=$pidfile" required_dirs=$(getconf datadir "/var/lib/mysql") + if [ ! -d $required_dirs/mysql ]; then eerror "Datadir '$required_dirs' is empty or invalid." eerror "Run '/etc/init.d/mariadb setup' to create new database." @@ -38,3 +29,13 @@ stop_pre() { pidfile=$(getconf pid-file "/run/mysqld/mysqld.pid") } +setup() { + ebegin "Creating a new MySQL database" + mysql_install_db --user=mysql --datadir=/var/lib/mysql + eend $? +} + +getconf() { + v=$(my_print_defaults --mysqld | grep ^--$1) + [ -z $v ] && echo $2 || echo ${v#*=} +} |