* [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/, dev-db/mysql-init-scripts/files/
@ 2015-05-14 2:25 Brian Evans
0 siblings, 0 replies; 2+ messages in thread
From: Brian Evans @ 2015-05-14 2:25 UTC (permalink / raw
To: gentoo-commits
commit: 6c32023dd3eba7c3d55ed30457487074c1bd2bb5
Author: Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu May 14 02:25:29 2015 +0000
Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu May 14 02:25:29 2015 +0000
URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=6c32023d
Version bump to mark openrc move and add logging support
dev-db/mysql-init-scripts/files/log-s6 | 12 ++++
dev-db/mysql-init-scripts/files/run-s6 | 2 +-
.../mysql-init-scripts-2.1_alpha1.ebuild | 77 ----------------------
.../mysql-init-scripts-2.1_alpha2.ebuild | 56 ++++++++++++++++
4 files changed, 69 insertions(+), 78 deletions(-)
diff --git a/dev-db/mysql-init-scripts/files/log-s6 b/dev-db/mysql-init-scripts/files/log-s6
new file mode 100644
index 0000000..dca71a8
--- /dev/null
+++ b/dev-db/mysql-init-scripts/files/log-s6
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $--NF }' )
+mkdir -p "/var/log/mysql/${SVCNAME}"
+if [ ${S6_LOG_OPTIONS} ] ; then
+ exec s6-log ${S6_LOG_OPTIONS}
+else
+ exec s6-log -b n20 S15000000 T !"gzip -nq9" "/var/log/mysql/${SVCNAME}"
+fi
diff --git a/dev-db/mysql-init-scripts/files/run-s6 b/dev-db/mysql-init-scripts/files/run-s6
index 64a89c7..a9615a1 100644
--- a/dev-db/mysql-init-scripts/files/run-s6
+++ b/dev-db/mysql-init-scripts/files/run-s6
@@ -15,4 +15,4 @@ source "${ROOT:-/}etc/conf.d/${SVCNAME}"
MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
-exec s6-notifywhenup -t ${STARTUP_TIMEOUT:-900} "${basedir}"/sbin/mysqld --defaults-file="${MY_CNF}" ${MY_ARGS}
+exec "${basedir}"/sbin/mysqld --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha1.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha1.ebuild
deleted file mode 100644
index 232246d..0000000
--- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha1.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI=5
-
-inherit systemd
-
-DESCRIPTION="Gentoo MySQL init scripts."
-HOMEPAGE="http://www.gentoo.org/"
-SRC_URI=""
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
-IUSE="s6"
-
-DEPEND=""
-# This _will_ break with MySQL 5.0, 4.x, 3.x
-# It also NEEDS openrc for the save_options/get_options builtins.
-RDEPEND="
- !<dev-db/mysql-5.1
- s6? ( >=sys-apps/openrc-0.16 sys-apps/s6 )
- "
-# 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"
- if use s6 ; then
- newinitd "${FILESDIR}/init.d-s6" "mysql"
- exeinto /etc/svc.d/mysql
- newexe "${FILESDIR}/run-s6" "run"
- else
- newinitd "${FILESDIR}/init.d-2.0" "mysql"
- fi
-
- # systemd unit installation
- exeinto /usr/libexec
- doexe "${FILESDIR}"/mysqld-wait-ready
- systemd_dounit "${FILESDIR}/mysqld.service"
- systemd_newunit "${FILESDIR}/mysqld_at.service" "mysqld@.service"
- systemd_dotmpfilesd "${FILESDIR}/mysql.conf"
-
- insinto /etc/logrotate.d
- newins "${FILESDIR}/logrotate.mysql" "mysql"
-}
-
-pkg_postinst() {
- grep -sq mysql_slot "${ROOT}"/etc/conf.d/mysql
- old_conf_present=$?
- grep -sq get_slot_config "${ROOT}"/etc/init.d/mysql
- old_init_present=$?
-
- egrep -sq 'MY_CNF|MY_ARGS|(STARTUP|STOP)_TIMEOUT' "${ROOT}"/etc/conf.d/mysql
- new_conf_present=$?
- egrep -sq 'MY_ARGS|STOP_TIMEOUT' "${ROOT}"/etc/init.d/mysql
- new_init_present=$?
-
- einfo "Please note that if you are using multiple internal 'slots' in the"
- einfo "old conf.d file, you should use multiple init files now."
- echo old $old_conf_present $old_init_present
- echo new $new_conf_present $new_init_present
-
- # new scripts present
- if [ $new_conf_present -eq 0 -a $new_init_present -eq 0 -a \
- $old_conf_present -eq 1 -a $old_init_present -eq 1 ]; then
- :
- elif [ $old_conf_present -eq 0 -a $old_init_present -eq 0 -a \
- $new_conf_present -eq 1 -a $new_init_present -eq 1 ]; then
- ewarn "Old /etc/init.d/mysql and /etc/conf.d/mysql still present!"
- ewarn "Update both of those files to the new versions!"
- else
- eerror "DANGER, mixed update of /etc/init.d/mysql and /etc/conf.d/mysql"
- eerror "detected! You must update BOTH to the new versions"
- fi
-}
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
new file mode 100644
index 0000000..b8fcf01
--- /dev/null
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit systemd
+
+DESCRIPTION="Gentoo MySQL init scripts."
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="s6"
+
+DEPEND=""
+# This _will_ break with MySQL 5.0, 4.x, 3.x
+# It also NEEDS openrc for the save_options/get_options builtins.
+RDEPEND="
+ !<dev-db/mysql-5.1
+ s6? ( >=sys-apps/openrc-0.16.1 sys-apps/s6 )
+ "
+# 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"
+ if use s6 ; then
+ newinitd "${FILESDIR}/init.d-s6" "mysql"
+ exeinto /var/svc.d/mysql
+ newexe "${FILESDIR}/run-s6" "run"
+ exeinto /var/svc.d/mysql/log
+ newexe "${FILESDIR}/log-s6" "run"
+ else
+ newinitd "${FILESDIR}/init.d-2.0" "mysql"
+ fi
+
+ # systemd unit installation
+ exeinto /usr/libexec
+ doexe "${FILESDIR}"/mysqld-wait-ready
+ systemd_dounit "${FILESDIR}/mysqld.service"
+ systemd_newunit "${FILESDIR}/mysqld_at.service" "mysqld@.service"
+ systemd_dotmpfilesd "${FILESDIR}/mysql.conf"
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate.mysql" "mysql"
+}
+
+pkg_postinst() {
+ if use s6 ; then
+ einfo "If you wish to use s6 logging support, "
+ einfo "comment out the log-error setting in your my.cnf"
+ fi
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/, dev-db/mysql-init-scripts/files/
@ 2015-05-28 12:54 Brian Evans
0 siblings, 0 replies; 2+ messages in thread
From: Brian Evans @ 2015-05-28 12:54 UTC (permalink / raw
To: gentoo-commits
commit: 7ea5eeb49381fcdfbdee1714ef2eea9023411993
Author: layman <layman <AT> localhost>
AuthorDate: Thu May 28 12:55:26 2015 +0000
Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu May 28 12:55:26 2015 +0000
URL: https://gitweb.gentoo.org/proj/mysql.git/commit/?id=7ea5eeb4
[mysql-init-scripts] Version bump and header sync from portage
dev-db/mysql-init-scripts/files/init.d-s6 | 11 +++++++-
dev-db/mysql-init-scripts/files/log-s6 | 4 +--
dev-db/mysql-init-scripts/files/run-s6 | 17 +++---------
dev-db/mysql-init-scripts/metadata.xml | 3 ---
...ebuild => mysql-init-scripts-2.1_alpha3.ebuild} | 31 ++++++++++++----------
5 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/dev-db/mysql-init-scripts/files/init.d-s6 b/dev-db/mysql-init-scripts/files/init.d-s6
index 984c831..f856e1d 100644
--- a/dev-db/mysql-init-scripts/files/init.d-s6
+++ b/dev-db/mysql-init-scripts/files/init.d-s6
@@ -1,7 +1,7 @@
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
depend() {
use net.lo
@@ -41,6 +41,7 @@ start_pre() {
fi
# tail -n1 is critical as these we only want the last instance of the option
+ local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
local socket=$(get_config "${MY_CNF}" socket | tail -n1)
@@ -77,6 +78,14 @@ start_pre() {
eerror "Directory $piddir for pidfile does not exist and cannot be created"
return 1
fi
+
+ # Prepare env files to source
+ mkdir -p "/var/svc.d/${SVCNAME}"
+ echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${SVCNAME}/env"
+ echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${SVCNAME}/env"
+ echo "basedir=\"${basedir}\"" >> "/var/svc.d/${SVCNAME}/env"
+ mkdir -p "/var/svc.d/${SVCNAME}/log"
+ echo "SVCNAME=\"${SVCNAME}\"" > "/var/svc.d/${SVCNAME}/log/env"
}
start_post() {
diff --git a/dev-db/mysql-init-scripts/files/log-s6 b/dev-db/mysql-init-scripts/files/log-s6
index 965b235..06c2ae3 100644
--- a/dev-db/mysql-init-scripts/files/log-s6
+++ b/dev-db/mysql-init-scripts/files/log-s6
@@ -1,9 +1,9 @@
#!/bin/sh
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
-SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $--NF }' )
+if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
mkdir -p "/var/log/mysql/${SVCNAME}"
if [ ${S6_LOG_OPTIONS} ] ; then
exec s6-log ${S6_LOG_OPTIONS}
diff --git a/dev-db/mysql-init-scripts/files/run-s6 b/dev-db/mysql-init-scripts/files/run-s6
index a9615a1..aa83d84 100644
--- a/dev-db/mysql-init-scripts/files/run-s6
+++ b/dev-db/mysql-init-scripts/files/run-s6
@@ -1,18 +1,7 @@
#!/bin/sh
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
-get_config() {
- my_print_defaults --config-file="$1" mysqld |
- sed -n -e "s/^--$2=//p"
-}
-
-SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $NF }' )
-
-source "${ROOT:-/}etc/conf.d/${SVCNAME}"
-
-MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
-
-basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
-exec "${basedir}"/sbin/mysqld --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
+if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
+exec "${basedir}/sbin/mysqld" --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
diff --git a/dev-db/mysql-init-scripts/metadata.xml b/dev-db/mysql-init-scripts/metadata.xml
index c95e8ce..abf3529 100644
--- a/dev-db/mysql-init-scripts/metadata.xml
+++ b/dev-db/mysql-init-scripts/metadata.xml
@@ -2,7 +2,4 @@
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>mysql</herd>
- <use>
- <flag name='s6'>Install an OpenRC service that monitors using <pkg>sys-apps/s6</pkg> instead of using start-stop-daemon</flag>
- </use>
</pkgmetadata>
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
similarity index 55%
rename from dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
rename to dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
index ba6ccfc..34eae3b 100644
--- a/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha2.ebuild
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/mysql-init-scripts-2.1_alpha3.ebuild,v 1.1 2015/05/27 21:01:03 grknight Exp $
EAPI=5
@@ -12,31 +12,35 @@ SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
-IUSE="s6"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~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
- s6? ( >=sys-apps/openrc-0.16.2 sys-apps/s6 )
+ !<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"
- if use s6 ; then
- newinitd "${FILESDIR}/init.d-s6" "mysql"
- exeinto /var/svc.d/mysql
+
+ # s6 init scripts
+ if use amd64 || use x86 ; then
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6"
+ newinitd "${FILESDIR}/init.d-s6" "mysql-s6"
+ exeinto /var/svc.d/mysql-s6
newexe "${FILESDIR}/run-s6" "run"
- exeinto /var/svc.d/mysql/log
+ exeinto /var/svc.d/mysql-s6/log
newexe "${FILESDIR}/log-s6" "run"
- else
- newinitd "${FILESDIR}/init.d-2.0" "mysql"
fi
+ newinitd "${FILESDIR}/init.d-2.0" "mysql"
+
# systemd unit installation
exeinto /usr/libexec
doexe "${FILESDIR}"/mysqld-wait-ready
@@ -49,8 +53,7 @@ src_install() {
}
pkg_postinst() {
- if use s6 ; then
- einfo "If you wish to use s6 logging support, "
- einfo "comment out the log-error setting in your my.cnf"
- fi
+ einfo "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package."
+ einfo "If you wish to use s6 logging support, "
+ einfo "comment out the log-error setting in your my.cnf"
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-28 12:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 2:25 [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/, dev-db/mysql-init-scripts/files/ Brian Evans
-- strict thread matches above, loose matches on Subject: below --
2015-05-28 12:54 Brian Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox