From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 869DA138CCF for ; Wed, 13 May 2015 03:15:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80FCBE07E1; Wed, 13 May 2015 03:15:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EFBAAE07E1 for ; Wed, 13 May 2015 03:15:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 92E88340E36 for ; Wed, 13 May 2015 03:15:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1B0139D3 for ; Wed, 13 May 2015 03:15:50 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1431486939.e1420dbafbafbe14f303da3ff96a9ef456e77cc8.grknight@gentoo> Subject: [gentoo-commits] proj/mysql:master commit in: dev-db/mysql-init-scripts/files/ X-VCS-Repository: proj/mysql X-VCS-Files: dev-db/mysql-init-scripts/files/init.d-2.0 dev-db/mysql-init-scripts/files/init.d-s6 X-VCS-Directories: dev-db/mysql-init-scripts/files/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: e1420dbafbafbe14f303da3ff96a9ef456e77cc8 X-VCS-Branch: master Date: Wed, 13 May 2015 03:15:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 441ebcac-25cb-4db5-a0d4-0f801e2b3c56 X-Archives-Hash: e5f934697982581d7302a128a8f5620b commit: e1420dbafbafbe14f303da3ff96a9ef456e77cc8 Author: Brian Evans gentoo org> AuthorDate: Wed May 13 01:51:50 2015 +0000 Commit: Brian Evans gentoo 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: