diff options
author | Francesco Riosa <vivo@gentoo.org> | 2005-11-20 13:37:21 +0000 |
---|---|---|
committer | Francesco Riosa <vivo@gentoo.org> | 2005-11-20 13:37:21 +0000 |
commit | b0fb9b54b87c14f35689904b1e456641506dcbc5 (patch) | |
tree | 467c4cef8b1ea7f1d59d771fd4a301ef200655d1 /dev-db | |
parent | Version bumped. (diff) | |
download | historical-b0fb9b54b87c14f35689904b1e456641506dcbc5.tar.gz historical-b0fb9b54b87c14f35689904b1e456641506dcbc5.tar.bz2 historical-b0fb9b54b87c14f35689904b1e456641506dcbc5.zip |
modified rc6 script for slotted server. Return status OK if at least on server is started.
Package-Manager: portage-2.0.53_rc6
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/mysql/ChangeLog | 6 | ||||
-rw-r--r-- | dev-db/mysql/files/digest-mysql-3.23.58-r1 | 2 | ||||
-rw-r--r-- | dev-db/mysql/files/mysql-slot.rc6 | 34 |
3 files changed, 27 insertions, 15 deletions
diff --git a/dev-db/mysql/ChangeLog b/dev-db/mysql/ChangeLog index 15f4ea41d24c..ccb2aedbfba3 100644 --- a/dev-db/mysql/ChangeLog +++ b/dev-db/mysql/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-db/mysql # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.261 2005/11/19 03:58:40 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/ChangeLog,v 1.262 2005/11/20 13:37:20 vivo Exp $ + + 20 Nov 2005; Francesco Riosa <vivo@gentoo.org> files/mysql-slot.rc6: + modified rc6 script for slotted server. Return status OK if at least on server + is started. 19 Nov 2005; Francesco Riosa <vivo@gentoo.org> +files/mysql-slot.conf.d, +files/mysql-slot.rc6: diff --git a/dev-db/mysql/files/digest-mysql-3.23.58-r1 b/dev-db/mysql/files/digest-mysql-3.23.58-r1 index 3a6dd30d9c0f..70bf4d4b2767 100644 --- a/dev-db/mysql/files/digest-mysql-3.23.58-r1 +++ b/dev-db/mysql/files/digest-mysql-3.23.58-r1 @@ -1,2 +1,2 @@ MD5 835a96c86132fbde0db36db60c5b34cd mysql-3.23.58.tar.gz 12039843 -MD5 5a936d382232f7b4b15fc7d025e9fa8e mysql-extras-20050920.tar.bz2 51007 +MD5 c0c0a0e816f38bc6cbd2fa5c2ef82423 mysql-extras-20050920.tar.bz2 51007 diff --git a/dev-db/mysql/files/mysql-slot.rc6 b/dev-db/mysql/files/mysql-slot.rc6 index 1b9ceb963813..75efdb637d5c 100644 --- a/dev-db/mysql/files/mysql-slot.rc6 +++ b/dev-db/mysql/files/mysql-slot.rc6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-slot.rc6,v 1.1 2005/11/19 03:58:41 vivo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-slot.rc6,v 1.2 2005/11/20 13:37:21 vivo Exp $ # external binaryes used: which, sed, tac @@ -13,6 +13,7 @@ depend() { function in_list() { local elem=${1:-"none"} local list=${2:-","} + [[ "${list}" == "${list/,${elem},/}" ]] \ && return 1 \ || return 0 @@ -99,24 +100,24 @@ get_slot_config() { for my_default in ${my_defaults}; do case "${my_default}" in --basedir=*) - if ! $(in_list "${my_default%%=*}" "${paramlist}") ; then + if ! in_list "${my_default%%=*}" "${paramlist}" ; then basedir="${my_default#--basedir=}" fi ;; --datadir=*) - if ! $(in_list "${my_default%%=*}" "${paramlist}") ; then + if ! in_list "${my_default%%=*}" "${paramlist}" ; then datadir="${my_default#--datadir=}" fi ;; --pid-file=*) - if ! $(in_list "${my_default%%=*}" "${paramlist}") ; then + if ! in_list "${my_default%%=*}" "${paramlist}" ; then pidfile="${my_default#--pid-file=}" fi ;; --socket=*) - if ! $(in_list "${my_default%%=*}" "${paramlist}") ; then + if ! in_list "${my_default%%=*}" "${paramlist}" ; then socket="${my_default#--socket=}" fi ;; *) # check into the list of parameters we already have - if ! $(in_list "${my_default%%=*}" "${paramlist}") ; then + if ! in_list "${my_default%%=*}" "${paramlist}" ; then paramlist="${paramlist}${my_default%%=*}," unmanagedparams="${unmanagedparams} $(echo "${my_default}" | sed -e 's,\([^=/a-zA-Z0-9_.-]\),\\\1,g')" fi @@ -132,7 +133,7 @@ get_slot_config() { done for i in "server-id" "log-bin" ; do - if ! $(in_list "--${i}" "${paramlist}") ; then + if ! in_list "--${i}" "${paramlist}" ; then ewarn "undefined $i, it's good practice set it" fi done @@ -171,8 +172,7 @@ start() { local globretstatus=1 local srv_slot srv_num # server MUST NOT share same location for these - local pidfilelist=',' - local datadirlist=',' + local pidfilelist=',' datadirlist=',' socketlist=',' # additional security rm -f "${MYSQL_GLOB_PID_FILE}" ; touch "${MYSQL_GLOB_PID_FILE}" @@ -198,24 +198,28 @@ start() { retstatus=0 get_slot_config "${srv_slot}" "${srv_num}" || retstatus=1 - # pre_run checks [[ "$retstatus" -eq 0 ]] && checkconfig "${datadir}" || retstatus=2 if [[ "$retstatus" -eq 0 ]] ; then - if $(in_list "${pidfile}" "${pidfilelist}"); then + if in_list "${pidfile}" "${pidfilelist}" ; then retstatus=3 eerror "Cowardly refusing to start another server with same ${pidfile}" fi - if $(in_list "${datadir}" "${datadirlist}"); then + if in_list "${datadir}" "${datadirlist}" ; then retstatus=4 eerror "Cowardly refusing to start another server with same ${datadir}" fi + if in_list "${socket}" "${socketlist}" ; then + retstatus=5 + eerror "Cowardly refusing to start another server with same ${socket}" + fi fi if [[ $retstatus -eq 0 ]] ; then # additional security rm -f ${pidfile} ${socket} ebegin "Starting mysqld${MY_SUFFIX:+"_"}${srv_slot}${srv_num:+"_"}${srv_num} (${MY_CNF})" + start-stop-daemon --start --quiet --background \ ${NICE:+"--nicelevel="}${NICE} \ --pidfile="${pidfile}" \ @@ -235,6 +239,10 @@ start() { if [[ ! -S "${socket}" ]] ; then eerror "MySQL${MY_SUFFIX} NOT started (${retstatus})" retstatus=1 + else + pidfilelist="${pidfilelist}${pidfile}," + datadirlist="${datadirlist}${datadir}," + socketlist="${socketlist}${socket}," fi fi @@ -244,7 +252,7 @@ start() { fi done # successfull if at least one mysqld started - eend $retstatus + eend $globretstatus } stop () { |