public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/files/
@ 2015-05-13  3:15 Brian Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Evans @ 2015-05-13  3:15 UTC (permalink / raw
  To: gentoo-commits

commit:     e1420dbafbafbe14f303da3ff96a9ef456e77cc8
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Wed May 13 01:51:50 2015 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed May 13 03:15:39 2015 +0000
URL:        https://gitweb.gentoo.org/proj/mysql.git/commit/?id=e1420dba

Sync init script from portage; bashism and checkconfig fixes

 dev-db/mysql-init-scripts/files/init.d-2.0 | 33 ++++++++++++++++++------------
 dev-db/mysql-init-scripts/files/init.d-s6  | 31 +++++++++++++++++-----------
 2 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/dev-db/mysql-init-scripts/files/init.d-2.0 b/dev-db/mysql-init-scripts/files/init.d-2.0
index 5dc99d2..2d05745 100644
--- a/dev-db/mysql-init-scripts/files/init.d-2.0
+++ b/dev-db/mysql-init-scripts/files/init.d-2.0
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2014 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-2.0,v 1.3 2014/09/23 01:23:27 grknight Exp $
 
 extra_commands="checkconfig"
 
@@ -73,7 +73,7 @@ start() {
 		# find which package is installed to report an error
 		local EROOT=$(portageq envvar EROOT)
 		local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql))
-		if [[ -z ${DBPKG_P} ]] ; then
+		if [ -z ${DBPKG_P} ] ; then
 			eerror "You don't appear to have a server package installed yet."
 		else
 			eerror "You don't appear to have the mysql database installed yet."
@@ -134,19 +134,26 @@ stop() {
 }
 
 checkconfig() {
-	local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
-	ebegin "Checking mysqld configuration"
-
-	# Suppress output to check the return value
-	"${basedir}"/sbin/mysqld --help --verbose &> /dev/null
-
-	# If the above command does not return 0,
-	# then there is an error to echo to the user
-	if [ $? -ne 0 ] ; then
-		"${basedir}"/sbin/mysqld --help --verbose > /dev/null
+	local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+	local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+	local svc_name=$(mysql_svcname)
+	ebegin "Checking mysqld configuration for ${svc_name}"
+
+	if [ ${RC_CMD} = "checkconfig" ] ; then
+		# We are calling checkconfig specifically.  Print warnings regardless.
+		"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+	else
+		# Suppress output to check the return value
+		"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+		# If the above command does not return 0,
+		# then there is an error to echo to the user
+		if [ $? -ne 0 ] ; then
+			"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+		fi
 	fi
 
-	eend $? "MySQL config check failed"
+	eend $? "${svc_name} config check failed"
 }
 
 # vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:

diff --git a/dev-db/mysql-init-scripts/files/init.d-s6 b/dev-db/mysql-init-scripts/files/init.d-s6
index 4c2424f..dfbe7f6 100644
--- a/dev-db/mysql-init-scripts/files/init.d-s6
+++ b/dev-db/mysql-init-scripts/files/init.d-s6
@@ -60,7 +60,7 @@ start_pre() {
 		# find which package is installed to report an error
 		local EROOT=$(portageq envvar EROOT)
 		local DBPKG_P=$(portageq match ${EROOT} $(portageq expand_virtual ${EROOT} virtual/mysql))
-		if [[ -z ${DBPKG_P} ]] ; then
+		if [ -z ${DBPKG_P} ] ; then
 			eerror "You don't appear to have a server package installed yet."
 		else
 			eerror "You don't appear to have the mysql database installed yet."
@@ -79,19 +79,26 @@ start_pre() {
 }
 
 checkconfig() {
-	local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
-	ebegin "Checking mysqld configuration"
-
-	# Suppress output to check the return value
-	"${basedir}"/sbin/mysqld --help --verbose &> /dev/null
-
-	# If the above command does not return 0,
-	# then there is an error to echo to the user
-	if [ $? -ne 0 ] ; then
-		"${basedir}"/sbin/mysqld --help --verbose > /dev/null
+	local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
+	local basedir=$(get_config "${my_cnf}" basedir | tail -n1)
+	local svc_name=$(mysql_svcname)
+	ebegin "Checking mysqld configuration for ${svc_name}"
+
+	if [ ${RC_CMD} = "checkconfig" ] ; then
+		# We are calling checkconfig specifically.  Print warnings regardless.
+		"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+	else
+		# Suppress output to check the return value
+		"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null 2>&1
+
+		# If the above command does not return 0,
+		# then there is an error to echo to the user
+		if [ $? -ne 0 ] ; then
+			"${basedir}"/sbin/mysqld --defaults-file="${my_cnf}" --help --verbose > /dev/null
+		fi
 	fi
 
-	eend $? "MySQL config check failed"
+	eend $? "${svc_name} config check failed"
 }
 
 # vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/files/
@ 2015-05-13 23:59 Brian Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Evans @ 2015-05-13 23:59 UTC (permalink / raw
  To: gentoo-commits

commit:     94b080b8ac948a9d940d4d902478ab941870ffa7
Author:     layman <layman <AT> localhost>
AuthorDate: Wed May 13 18:22:16 2015 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed May 13 18:22:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/mysql.git/commit/?id=94b080b8

Wait for server to come available under s6

 dev-db/mysql-init-scripts/files/init.d-s6 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dev-db/mysql-init-scripts/files/init.d-s6 b/dev-db/mysql-init-scripts/files/init.d-s6
index dfbe7f6..da97b30 100644
--- a/dev-db/mysql-init-scripts/files/init.d-s6
+++ b/dev-db/mysql-init-scripts/files/init.d-s6
@@ -78,6 +78,17 @@ start_pre() {
 	fi
 }
 
+start_post() {
+	local socket=$(get_config "${MY_CNF}" socket | tail -n1)
+	local chroot=$(get_config "${MY_CNF}" chroot | tail -n1)
+	local startup_timeout=${STARTUP_TIMEOUT:-900}
+
+	if [ -n "${chroot}" ] ; then
+		socket="${chroot}/${socket}"
+	fi
+	ewaitfile ${startup_timeout} "${socket}"
+}
+
 checkconfig() {
 	local my_cnf="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
 	local basedir=$(get_config "${my_cnf}" basedir | tail -n1)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/files/
@ 2015-05-14 18:42 Brian Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Evans @ 2015-05-14 18:42 UTC (permalink / raw
  To: gentoo-commits

commit:     4d058964c976ac76af8a9b0829dad10c080ab03f
Author:     layman <layman <AT> localhost>
AuthorDate: Thu May 14 18:43:44 2015 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu May 14 18:43:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/mysql.git/commit/?id=4d058964

Remove the T option from log-s6 as mysql already includes a timestamp of its own

 dev-db/mysql-init-scripts/files/log-s6 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-db/mysql-init-scripts/files/log-s6 b/dev-db/mysql-init-scripts/files/log-s6
index dca71a8..965b235 100644
--- a/dev-db/mysql-init-scripts/files/log-s6
+++ b/dev-db/mysql-init-scripts/files/log-s6
@@ -8,5 +8,5 @@ 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}"
+	exec s6-log -b n20 S15000000 !"gzip -nq9" "/var/log/mysql/${SVCNAME}"
 fi


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-14 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 23:59 [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/files/ Brian Evans
  -- strict thread matches above, loose matches on Subject: below --
2015-05-14 18:42 Brian Evans
2015-05-13  3:15 Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox