Skip to content

Commit

Permalink
mariadb*-server: Run mysql_install_db if required.
Browse files Browse the repository at this point in the history
  • Loading branch information
jperkin committed Mar 7, 2023
1 parent 13b9b4a commit 76ca8ff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion databases/mariadb104-server/files/smf/mariadb.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!@SMF_METHOD_SHELL@
#
# $NetBSD: mariadb.sh,v 1.2 2023/02/10 09:44:01 jperkin Exp $
# $NetBSD: mariadb.sh,v 1.3 2023/03/07 11:06:28 jperkin Exp $
#
# Init script for mysqld.
#
Expand All @@ -13,6 +13,12 @@ ulimit -n 10240

case "$1" in
start)
if [ ! -d @MARIADB_DATADIR@/mysql ]; then
@LOCALBASE@/bin/mysql_install_db \
--datadir=@MARIADB_DATADIR@ \
--user=@MARIADB_USER@
fi

@LOCALBASE@/sbin/mysqld --user=@MARIADB_USER@ \
--basedir=@LOCALBASE@ \
--datadir=@MARIADB_DATADIR@ \
Expand Down
8 changes: 7 additions & 1 deletion databases/mariadb105-server/files/smf/mariadb.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!@SMF_METHOD_SHELL@
#
# $NetBSD: mariadb.sh,v 1.2 2023/02/10 09:44:01 jperkin Exp $
# $NetBSD: mariadb.sh,v 1.3 2023/03/07 11:06:28 jperkin Exp $
#
# Init script for mysqld.
#
Expand All @@ -13,6 +13,12 @@ ulimit -n 10240

case "$1" in
start)
if [ ! -d @MARIADB_DATADIR@/mysql ]; then
@LOCALBASE@/bin/mysql_install_db \
--datadir=@MARIADB_DATADIR@ \
--user=@MARIADB_USER@
fi

@LOCALBASE@/sbin/mariadbd --user=@MARIADB_USER@ \
--basedir=@LOCALBASE@ \
--datadir=@MARIADB_DATADIR@ \
Expand Down
8 changes: 7 additions & 1 deletion databases/mariadb106-server/files/smf/mariadb.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!@SMF_METHOD_SHELL@
#
# $NetBSD: mariadb.sh,v 1.2 2022/04/20 17:36:03 tm Exp $
# $NetBSD: mariadb.sh,v 1.3 2023/03/07 11:06:28 jperkin Exp $
#
# Init script for mysqld.
#
Expand All @@ -13,6 +13,12 @@ ulimit -n 10240

case "$1" in
start)
if [ ! -d @MARIADB_DATADIR@/mysql ]; then
@LOCALBASE@/bin/mysql_install_db \
--datadir=@MARIADB_DATADIR@ \
--user=@MARIADB_USER@
fi

@LOCALBASE@/sbin/mariadbd --user=@MARIADB_USER@ \
--basedir=@LOCALBASE@ \
--datadir=@MARIADB_DATADIR@ \
Expand Down

0 comments on commit 76ca8ff

Please sign in to comment.