dev-db/mysql-init-scripts: Add 'keyword -timeout'
authorBrian Evans <grknight@gentoo.org>
Wed, 24 Jan 2018 21:50:44 +0000 (16:50 -0500)
committerBrian Evans <grknight@gentoo.org>
Wed, 24 Jan 2018 21:55:36 +0000 (16:55 -0500)
It may take longer than 60 seconds to startup.  Let the script
handle any timeouts.

Package-Manager: Portage-2.3.20, Repoman-2.3.6

dev-db/mysql-init-scripts/files/init.d-2.2
dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild [new file with mode: 0644]

index f6ad52496e4e12798f1d03edc07de8c0dca72a26..5603f9e60310ebbcd262e3ee6ccc38f8c5b4f41a 100644 (file)
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 extra_commands="checkconfig"
@@ -12,6 +12,9 @@ depend() {
        use net.lo
        # localmount needed for $basedir
        need localmount
+       # This service has its own timeout and may need to wait for repairs
+       # or remote synchronization
+       keyword -timeout
 }
 
 get_config() {
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.2-r3.ebuild
new file mode 100644 (file)
index 0000000..f405a38
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd s6
+
+DESCRIPTION="Gentoo MySQL init scripts."
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+# This _will_ break with MySQL 5.0, 4.x, 3.x
+# It also NEEDS openrc for the save_options/get_options builtins.
+# The s6 support was added after openrc 0.16.2
+RDEPEND="
+       !<dev-db/mysql-5.1
+       !<sys-apps/openrc-0.16.2
+       "
+# Need to set S due to PMS saying we need it existing, but no SRC_URI
+S=${WORKDIR}
+
+src_install() {
+       newconfd "${FILESDIR}/conf.d-2.0" "mysql"
+
+       # s6 init scripts
+       if use amd64 || use x86 ; then
+               newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
+               newinitd "${FILESDIR}/init.d-s6-2.2" "mysql-s6"
+               s6_install_service mysql "${FILESDIR}/run-s6"
+               s6_install_service mysql/log "${FILESDIR}/log-s6"
+       fi
+
+       newinitd "${FILESDIR}/init.d-2.2" "mysql"
+       newinitd "${FILESDIR}/init.d-supervise" "mysql-supervise"
+
+       # systemd unit installation
+       exeinto /usr/libexec
+       doexe "${FILESDIR}"/mysqld-wait-ready
+       systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service"
+       systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service"
+       systemd_dotmpfilesd "${FILESDIR}/mysql.conf"
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/logrotate.mysql" "mysql"
+}
+
+pkg_postinst() {
+       if use amd64 || use x86 ; then
+               elog ""
+               elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
+               elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf"
+       fi
+
+       elog ""
+       elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service"
+       elog "You should prefer that unit over this package's mysqld.service."
+       einfo ""
+}