diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-09-30 07:13:00 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2022-09-30 09:09:28 -0400 |
commit | db2b3b1de37cc4b5918ef2720cf9c4ea00960596 (patch) | |
tree | c6173bd4cf621726d77bbf557945f5c7ee90aaed | |
parent | 4ba032a04a2b4488ee41b462ef1ba0c0902302d7 (diff) |
[mariadb-openrc]: add package
-rw-r--r-- | nonsystemd/mariadb-openrc/PKGBUILD | 23 | ||||
-rw-r--r-- | nonsystemd/mariadb-openrc/mariadb-supervise.initd | 38 | ||||
-rw-r--r-- | nonsystemd/mariadb-openrc/mariadb.initd | 36 | ||||
-rw-r--r-- | pcr/openrc-devel/PKGBUILD | 20 |
4 files changed, 98 insertions, 19 deletions
diff --git a/nonsystemd/mariadb-openrc/PKGBUILD b/nonsystemd/mariadb-openrc/PKGBUILD new file mode 100644 index 000000000..c051e14fd --- /dev/null +++ b/nonsystemd/mariadb-openrc/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer (artix): nous <nous@artixlinux.org> +# Maintainer: Parabola Hackers <dev@lists.parabola.nu> + +pkgname=mariadb-openrc +pkgver=20210505 +pkgrel=2 +pkgdesc="OpenRC mariadb init script" +arch=('any') +url="https://gitea.artixlinux.org/artixlinux/packages-openrc" +license=('GPL2') +groups=('openrc-world') +provides=('mysql-openrc' 'init-mariadb') +depends=('mariadb' 'openrc') +conflicts=('init-mariadb') +replaces=('mysql-openrc') +source=('mariadb.initd' 'mariadb-supervise.initd') +sha256sums=('e047da01dcf47692f01daf0f37eba2e9669f459bba265bd75337f187f097e40c' + 'bb5281b04e7a8dd6048b8e7756969d683c6fa2231434615b540cf5310e63efb8') + +package() { + install -Dm755 "${srcdir}"/mariadb.initd "${pkgdir}"/etc/init.d/mariadb + install -Dm755 "${srcdir}"/mariadb-supervise.initd "${pkgdir}"/etc/init.d/mariadb-supervise +} diff --git a/nonsystemd/mariadb-openrc/mariadb-supervise.initd b/nonsystemd/mariadb-openrc/mariadb-supervise.initd new file mode 100644 index 000000000..eb77c9a5b --- /dev/null +++ b/nonsystemd/mariadb-openrc/mariadb-supervise.initd @@ -0,0 +1,38 @@ +#!/usr/bin/openrc-run +extra_stopped_commands="setup" +supervisor=supervise-daemon +#healthcheck_timer=10 + +retry="60" +pidfile="/run/mysqld/$RC_SVCNAME.pid" +command="/usr/bin/mysqld" +command_args="--basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --pid-file=/run/mysqld/mariadb.pid" + +depend() { + use net + need localmount +} + +start_pre() { + 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." + fi +} + +start_post() { + ewaitfile 10 $(getconf socket "/run/mysqld/mysqld.sock") +} + +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#*=} +} diff --git a/nonsystemd/mariadb-openrc/mariadb.initd b/nonsystemd/mariadb-openrc/mariadb.initd new file mode 100644 index 000000000..c78795f05 --- /dev/null +++ b/nonsystemd/mariadb-openrc/mariadb.initd @@ -0,0 +1,36 @@ +#!/usr/bin/openrc-run +extra_stopped_commands="setup" + +retry="60" +pidfile="/run/mysqld/$RC_SVCNAME.pid" +command="/usr/bin/mysqld_safe" +command_args="--syslog --nowatch --pid-file=$pidfile" + +depend() { + use net + need localmount +} + +start_pre() { + 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." + fi +} + +start_post() { + ewaitfile 10 $(getconf socket "/run/mysqld/mysqld.sock") +} + +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#*=} +} diff --git a/pcr/openrc-devel/PKGBUILD b/pcr/openrc-devel/PKGBUILD index 5abe43bc2..71179ff59 100644 --- a/pcr/openrc-devel/PKGBUILD +++ b/pcr/openrc-devel/PKGBUILD @@ -1,4 +1,4 @@ -# Maintainer (Artix): artoo <artoo@cromnix.org> +# Maintainer (artix): artoo <artoo@cromnix.org> # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> _url="https://raw.githubusercontent.com/gentoo/gentoo/master" @@ -12,7 +12,6 @@ pkgbase=openrc-devel pkgname=('distcc-openrc' 'git-openrc' 'jenkins-openrc' - 'mysql-openrc' #'php-fpm-openrc' 'postgresql-openrc' 'subversion-openrc') @@ -30,8 +29,6 @@ source=("distccd.confd::${_url}/sys-devel/distcc/files/3.2/conf" "git-daemon.initd::${_url}/dev-vcs/git/files/git-daemon-r1.initd" 'jenkins.initd' "jenkins.logrotate" - "mysql.confd::${_url}/dev-db/mysql-init-scripts/files/conf.d-2.0" - "mysql.initd::${_url}/dev-db/mysql-init-scripts/files/init.d-2.0" #"php-fpm.initd::${_url}/dev-lang/php/files/php-fpm-r4.init" "postgresql.confd::${_url}/dev-db/postgresql/files/postgresql.confd" "postgresql.initd::${_url}/dev-db/postgresql/files/postgresql.init-9.3" @@ -43,8 +40,6 @@ sha256sums=('253cfaa5b53fe4943a9db83e76ff6d6e8855665f69c2f7beca124af3ec63c88a' 'c39eff8e0d0156f035b987521444476875852519ddfe6b36ea5c205d93a7f323' '7ef50b386bef359224dffb964387f651aa02cd610c3f73d585fa3ae78e9becee' '03dcaccbb0d398c2b600be0752ffc68d20c877b58a10026b7c59b0bd40c0e5bf' - 'b94756f2a5fe43893dea90fadbe47308e50fb4dbe2cbaa2676f34fa88181d8e7' - 'b6eb4576e654b1f4a8138df04408935a07fab69775e9663f736133c71bbb414b' '57c1ad0b14e8458024c713dd8cc2390023b95c27ba4cbd637333b1020f11f398' '120e872848eb13c949179b22f00a31bd043823ac75c547374225c6c3620a827d' '45f2dc1a718aed885559e71d98112e670c92bd6b4f19c5cf593eced6cd2bbd97' @@ -95,19 +90,6 @@ package_jenkins-openrc() { install -Dm644 "${srcdir}/jenkins.logrotate" "${pkgdir}/etc/logrotate.d/jenkins" } -package_mysql-openrc() { - pkgdesc="OpenRC mysql init script" - depends=('mysql' 'openrc') - optdepends=('bind-openrc: bind initscript') - backup=('etc/conf.d/mysql') - install=mysql.install - - _inst_confd 'mysql' - _inst_initd 'mysql' - - sed -e 's|/sbin/mysqld|/bin/mysqld|g' -i "${pkgdir}/etc/init.d/mysql" -} - # package_php-fpm-openrc() { # pkgdesc="OpenRC php-fpm init script" # depends=('php-fpm' 'openrc') |