Package: mysql-server-4.1 Version: 4.1.9-4 Severity: important Tags: patch
The preinst file for mysql-server-4.1 does not work correctly when run from within a chroot'ed
evironment. It uses a simple "ps" to determine if mysqld is running and attempts to stop it. When stopping
mysqld fails (because the mysqld instance is running outside the chroot'ed environment) the package
installation fails. I suspect this bug is present in multiple versions of the mysql-server package.
I suggest checking to see if the running mysqld binary(ies) actually exist(s) in the current environment
using the full path of the binary (as reported by ps).
Below is a patch which implements my suggestion:
*** mysql-server-4.1.preinst.orig Thu Feb 10 18:07:00 2005
--- mysql-server-4.1.preinst Thu Feb 10 19:52:15 2005
***************
*** 17,23 ****
# do it himself. No database directories should be removed while the server
# is running!
stop_server() {
! if [ -n "`$MYADMIN ping 2>/dev/null`" -o "`ps cax | grep -c ' mysqld$'`" != 0 ]; then
set +e
if [ -x /usr/sbin/invoke-rc.d ]; then
cmd="invoke-rc.d mysql stop"
--- 17,28 ----
# do it himself. No database directories should be removed while the server
# is running!
stop_server() {
! for running_mysqld in `ps -eo command | cut -d" " -f1 | grep '/mysqld$' | sort | uniq | xargs`; do
! if [ -e $running_mysqld ]; then
! FOUND_RUNNING_MYSQLD_BINARY="true"
! fi
! done
! if [ -n "`$MYADMIN ping 2>/dev/null`" -o -n "$FOUND_RUNNING_MYSQLD_BINARY" ]; then
set +e
if [ -x /usr/sbin/invoke-rc.d ]; then
cmd="invoke-rc.d mysql stop"
-- System Information Debian Release: 3.0 Architecture: i386 Kernel: Linux wmtest 2.4.20-28.7 #1 Thu Dec 18 11:31:59 EST 2003 i686 Locale: LANG=en_US.iso885915, LC_CTYPE=en_US.iso885915
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

