summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Riosa <vivo@gentoo.org>2006-03-02 23:08:41 +0000
committerFrancesco Riosa <vivo@gentoo.org>2006-03-02 23:08:41 +0000
commit5ffc6d839f1572f913a9ad97418b0404f17bc409 (patch)
treeddda337d58f091ff4cfb38c4e19b9f3e57430151 /dev-db/mysql/files
parentVersion bump, bug #124532. (diff)
downloadgentoo-2-5ffc6d839f1572f913a9ad97418b0404f17bc409.tar.gz
gentoo-2-5ffc6d839f1572f913a9ad97418b0404f17bc409.tar.bz2
gentoo-2-5ffc6d839f1572f913a9ad97418b0404f17bc409.zip
minor imporovements in rc scripts
(Portage version: 2.1_pre5-r1)
Diffstat (limited to 'dev-db/mysql/files')
-rw-r--r--dev-db/mysql/files/mysql-slot.rc6-r328
1 files changed, 15 insertions, 13 deletions
diff --git a/dev-db/mysql/files/mysql-slot.rc6-r3 b/dev-db/mysql/files/mysql-slot.rc6-r3
index 217f74b056ef..b40d5c682231 100644
--- a/dev-db/mysql/files/mysql-slot.rc6-r3
+++ b/dev-db/mysql/files/mysql-slot.rc6-r3
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2006 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-r3,v 1.3 2006/02/05 16:59:03 vivo Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-slot.rc6-r3,v 1.4 2006/03/02 23:08:41 vivo Exp $
# external binaryes used: which, sed, tac
@@ -195,8 +195,8 @@ checkconfig() {
kill -15 $(< ${pidfile}) 2>/dev/null
if [[ $? -eq 0 ]] ; then
# the process exist, we have a problem
- eerror "\"${pidfile}\" is still present."
- eerror "Please check that no server is running."
+ eerror "\"${pidfile}\" is still present and the process is running."
+ eerror "Please stop it \"kill $(< ${pidfile})\" maybe ?"
wdebug 4 "<<< checkconfig() KO"
return 1
else
@@ -205,11 +205,10 @@ checkconfig() {
fi
if [[ -S ${socket} ]] ; then
- # this is candidate for removal
- eerror "\"${socket}\" is still present."
- eerror "Please check that it's not owned by other servers and then remove it."
- wdebug 4 "<<< checkconfig() KO"
- return 1
+ ewarn "Strange, the socket file already exist in \"${socket}\""
+ ewarn "it will be removed now and re-created by the MySQL server"
+ ewarn "BUT please make your checks."
+ rm -f "${socket}"
fi
wdebug 4 "<<< checkconfig() ok"
@@ -233,7 +232,7 @@ start() {
# server MUST NOT share same location for these
local pidfilelist=',' datadirlist=',' socketlist=','
local ssd_thing=1
- local mysqld_thing
+ local mysqld_thing tmpnice
ebegin
# try to start each server
@@ -279,12 +278,14 @@ start() {
wdebug 2 "starting mysqld with: ${mysqld_thing}"
if [[ ${ssd_thing} -eq 1 ]] ; then
+ tmpnice="${NICE:+"--nicelevel "}${NICE}"
start-stop-daemon --quiet ${DEBUG/*/"--verbose"} --start \
- --background ${NICE:+"--nicelevel "}${NICE} \
+ --background ${tmpnice} \
--exec ${basedir}/sbin/mysqld${MY_SUFFIX} -- ${mysqld_thing}
retstatus=$?
else
- ${basedir}/sbin/mysqld${MY_SUFFIX} ${mysqld_thing} &
+ tmpnice="${NICE:+"nice -n "}${NICE}"
+ ${tmpnice} ${basedir}/sbin/mysqld${MY_SUFFIX} ${mysqld_thing} &
retstatus=0
fi
@@ -323,7 +324,7 @@ stop() {
local retstatus=0
local shutdown_list="$(< "${MYSQL_GLOB_PID_FILE}" )"
- ebegin "Stopping ${myservice} (pid=${PID})"
+ ebegin "Stopping ${myservice}"
for shutdown_elem in $shutdown_list; do
runwhat=${shutdown_elem%%=*}
pidfile=${shutdown_elem#*=}
@@ -339,7 +340,7 @@ stop() {
start-stop-daemon --quiet ${DEBUG/*/"--verbose"} --stop --pidfile "${pidfile}" &
wdebug 1 ""
while [[ -n "$PID" ]] \
- && $( kill -15 $PID 2>/dev/null ) \
+ && $( ps -Ao pid | grep -q "^ *$PID$" ) \
&& [[ "${timeout}" -ge 1 ]]
do
timeout=$(($timeout - 1))
@@ -348,6 +349,7 @@ stop() {
done
[[ "${timeout}" -lt 1 ]] && retstatus=1
done
+ sleep ${TIMEUNIT}
[[ "$retstatus" -eq 0 ]] && rm -f "$MYSQL_GLOB_PID_FILE"
eend ${retstatus}
}