Bug#609897: mysql-server-core-5.1: "Mysqld failed" message on boot (still there)

January 13th, 2011 - 12:40 pm ET by r.ductor | Report spam
Package: mysql-server-core-5.1
Version: 5.1.49-3
Severity: normal

Apparently the bug I reported in #589513 which was classed fixed by 5.1.49-2 is still there in 5.1.49-3:
i.e. at boot I get a failed message, but after a ps gives a running mysqld.

# cat /var/log/boot|egrep 'failed'
Thu Jan 13 10:22:14 2011: Starting MySQL database server: mysqld . . . . . . . . . . . . . . ^[[31mfailed!^[[39;49m

# ps -edf|grep mysqld
ductor 2469 2467 0 10:28 ? 00:00:05 /usr/sbin/mysqld (...)

# aptitude show mysql-server-core-5.1
Package: mysql-server-core-5.1
New: yes
State: installed
Automatically installed: yes
Version: 5.1.49-3
Priority: optional
Section: misc
Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Uncompressed Size: 11.5 M
Architecture: amd64
Compressed Size: 4,124 k
Filename: pool/main/m/mysql-5.1/mysql-server-core-5.1_5.1.49-3_amd64.deb
MD5sum: 6fccf2a4006894bdb633b091a7a93477
Archive: testing, unstable, now
Depends: libc6 (>= 2.7), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libwrap0 (>= 7.6-4~), zlib1g (>= 1:1.1.4)
Conflicts: mysql-server-5.0 (< 5.1.45-2), mysql-server-5.1 (< 5.1.45-2)
Provides: mysql-server-core, mysql-server-core-5.0
Description: MySQL database server binaries
MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular
database query language in the world. The main goals of MySQL are speed, robustness and ease of use.

This package includes the server binaries but doesn't contain all the infrastructure needed to setup system databases.
Homepage: http://dev.mysql.com/

# aptitude search mysql-server-
c mysql-server-5.0 - MySQL database server binaries
c mysql-server-5.1 - MySQL database server binaries and system database setup
v mysql-server-core -
v mysql-server-core-5.0 -
i A mysql-server-core-5.1 - MySQL database server binaries
#


Debian Release: squeeze/sid
APT prefers testing
APT policy: (900, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages mysql-server-core-5.1 depends on:
ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib
ii libgcc1 1:4.4.5-8 GCC support library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libwrap0 7.6.q-19 Wietse Venema's TCP wrappers libra
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime

mysql-server-core-5.1 recommends no packages.

mysql-server-core-5.1 suggests no packages.




To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 6 repliesReplies Make a reply

Similar topics

Replies

#1 Norbert Tretkowski
January 14th, 2011 - 05:50 am ET | Report spam
Am Donnerstag, den 13.01.2011, 18:30 +0100 schrieb r.ductor:
Apparently the bug I reported in #589513 which was classed fixed by
5.1.49-2 is still there in 5.1.49-3:
i.e. at boot I get a failed message, but after a ps gives a running
mysqld.



Which version of mysql-server-5.1 do you have installed?

Please make sure that the mysql-server-5.1 package is also updated to
5.1.49-2 or newer.

Could you please also send me the mysqld related informations during
it's startup from /var/log/daemon.log?

Norbert




To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#2 Norbert Tretkowski
January 14th, 2011 - 08:30 am ET | Report spam
Hi Riccardo,

please keep the @bugs.debian.org address in CC, thanks.

Am Freitag, den 14.01.2011, 12:41 +0100 schrieb :
as shown below, I do not have the mysql-server-5.1 package at all.



The init script checks for mysqld_safe since 5.1.49-2, which is part of
the mysql-server-5.1 package.

Could you please check if /etc/init.d/mysql checks for mysqld_safe in
line 20 on your system?

Of course my problem might not be a bug of the core package, but a
dirty configuration inherited by bad automatic updates, as suggested
in http://bugs.debian.org/cgi-bin/bugr...ugX9513#13



Did you modify the init-script in the past? The init scripts are treated
as configuration files, so they will not get overwritten automatically
when upgrading the package and the init script was manually edited in
the past.

Does a file called /etc/init.d/mysql.dpkg-dist exist on your system?

Norbert




To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#3 r.ductor
January 14th, 2011 - 11:30 am ET | Report spam
Dear Norbert

as shown below, I do not have the mysql-server-5.1 package at all.

The point is that I do not explicitly use mysql and all mysql stuff that I have, namely mysql-server-core-5.1, come from automatic installations (as far as I remember).
In this sense having a "failed" message at boot should not happen, I'm I wrong?

It turned out from my previous bug report that there was a problem in a init script
http://bugs.debian.org/cgi-bin/bugr...ugX9513#16

Of course my problem might not be a bug of the core package, but a dirty configuration inherited by bad automatic updates, as suggested in
http://bugs.debian.org/cgi-bin/bugr...ugX9513#13
in this case any suggestion to clean up my state is welcome.

I was planning to aptitude full--upgrade but maybe I will wait your answer.

Thanks for your time, all my best
Riccardo


# cat /var/log/daemon.log|egrep -i mysql
Jan 14 10:03:28 galileo /etc/init.d/mysql[1925]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jan 14 10:03:28 galileo /etc/init.d/mysql[1925]: /etc/init.d/mysql: line 75: /usr/bin/mysqladmin: No such file or directory
Jan 14 10:03:28 galileo /etc/init.d/mysql[1925]:
#
# aptitude search mysql|egrep '^i'
i A libmysqlclient16 - MySQL database client library
i A libqt4-sql-mysql - Qt 4 MySQL database driver
i A mysql-common - MySQL database common files, e.g. /etc/mys
i A mysql-server-core-5.1 - MySQL database server binaries
# aptitude search mysql-server
p mysql-server - MySQL database server (metapackage depending on the latest version)
c mysql-server-5.0 - MySQL database server binaries
c mysql-server-5.1 - MySQL database server binaries and system database setup
v mysql-server-core -
v mysql-server-core-5.0 -
i A mysql-server-core-5.1 - MySQL database server binaries
v virtual-mysql-server -

On Friday 14 January 2011 11:41:15 you wrote:
Am Donnerstag, den 13.01.2011, 18:30 +0100 schrieb r.ductor:
> Apparently the bug I reported in #589513 which was classed fixed by
> 5.1.49-2 is still there in 5.1.49-3:
> i.e. at boot I get a failed message, but after a ps gives a running
> mysqld.

Which version of mysql-server-5.1 do you have installed?

Please make sure that the mysql-server-5.1 package is also updated to
5.1.49-2 or newer.

Could you please also send me the mysqld related informations during
it's startup from /var/log/daemon.log?

Norbert






To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#4 r.ductor
January 14th, 2011 - 11:40 am ET | Report spam

Dear Norbert

Could you please check if /etc/init.d/mysql checks for mysqld_safe in
line 20 on your system?



No, it tests -x /usr/sbin/mysqld
(but the #13 mentions mysqld_safe)

So, if I understand well,
either my /usr/sbin/mysqld does not correspond to >= 5.1.49-2 (for which reason has not been updated?)
or /usr/sbin/mysqld v5.1.49-2 is still buggy...
I attach my version of /usr/sbin/mysqld

Did you modify the init-script in the past? The init scripts are treated
as configuration files, so they will not get overwritten automatically
when upgrading the package and the init script was manually edited in
the past.



No, I do not think so (I do not use mysql at all).

Does a file called /etc/init.d/mysql.dpkg-dist exist on your system?



No

Riccardo

galileo:~# head -n 25 /etc/init.d/mysql|cat -n
1 #!/bin/bash
2 #
3 ### BEGIN INIT INFO
4 # Provides: mysql
5 # Required-Start: $remote_fs $syslog
6 # Required-Stop: $remote_fs $syslog
7 # Should-Start: $network $named $time
8 # Should-Stop: $network $named $time
9 # Default-Start: 2 3 4 5
10 # Default-Stop: 0 1 6
11 # Short-Description: Start and stop the mysql database server daemon
12 # Description: Controls the main MySQL database server daemon "mysqld"
13 # and its wrapper script "mysqld_safe".
14 ### END INIT INFO
15 #
16 set -e
17 set -u
18 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
19
20 test -x /usr/sbin/mysqld || exit 0
21
22 . /lib/lsb/init-functions
23
24 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
25 CONF=/etc/mysql/my.cnf
galileo:~# ls /etc/init.d/mysql.dpkg-dist
ls: cannot access /etc/init.d/mysql.dpkg-dist: No such file or directory
galileo:~#

name="etc_init.d_mysql_2011-01-14"
filename="etc_init.d_mysql_2011-01-14"

#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network $named $time
# Should-Stop: $network $named $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the mysql database server daemon
# Description: Controls the main MySQL database server daemon "mysqld"
# and its wrapper script "mysqld_safe".
### END INIT INFO
#
set -e
set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x}

test -x /usr/sbin/mysqld || exit 0

. /lib/lsb/init-functions

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
CONF=/etc/mysql/my.cnf
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

# priority can be overriden and "-s" adds output to stderr
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"

# Safeguard (relative paths, core dumps..)
cd /
umask 077

# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
# as many admins e.g. only store a password without a username there and
# so break my scripts.
export HOME=/etc/mysql/

## Fetch a particular option from mysql's invocation.
#
# Usage: void mysqld_get_param option
mysqld_get_param() {
/usr/sbin/mysqld --print-defaults \
| tr " " "" \
| grep -- "--$1" \
| tail -n 1 \
| cut -d= -f2
}

## Do some sanity checks before even trying to start mysqld.
sanity_checks() {
# check for config file
if [ ! -r /etc/mysql/my.cnf ]; then
log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
fi

# check for diskspace shortage
datadir=`mysqld_get_param datadir`
if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
exit 1
fi
}

## Checks if there is a server running and if so if it is accessible.
#
# check_alive insists on a pingable server
# check_dead also fails if there is a lost mysqld in the process list
#
# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
mysqld_status () {
ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))

ps_alive=0
pidfile=`mysqld_get_param pid-file`
if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi

if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
[ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
return 0 # EXIT_SUCCESS
else
if [ "$2" = "warn" ]; then
echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in$ping_output" | $ERR_LOGGER -p daemon.debug
fi
return 1 # EXIT_FAILURE
fi
}

#
# main()
#

case "${1:-''}" in
'start')
sanity_checks;
# Start daemon
log_daemon_msg "Starting MySQL database server" "mysqld"
if mysqld_status check_alive nowarn; then
log_progress_msg "already running"
log_end_msg 0
else
# Could be removed during boot
test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld

# Start MySQL!
/usr/bin/mysqld_safe > /dev/null 2>&1 &

# 6s was reported in #352070 to be too few when using ndbcluster
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
sleep 1
if mysqld_status check_alive nowarn ; then break; fi
log_progress_msg "."
done
if mysqld_status check_alive warn; then
log_end_msg 0
# Now start mysqlcheck or whatever the admin wants.
output=$(/etc/mysql/debian-start)
[ -n "$output" ] && log_action_msg "$output"
else
log_end_msg 1
log_failure_msg "Please take a look at the syslog"
fi
fi
;;

'stop')
# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
# at least for cron, we can rely on it here, too. (although we have
# to specify it explicit as e.g. sudo environments points to the normal
# users home and not /root)
log_daemon_msg "Stopping MySQL database server" "mysqld"
if ! mysqld_status check_dead nowarn; then
set +e
shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
set -e
if [ "$r" -ne 0 ]; then
log_end_msg 1
[ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
log_daemon_msg "Killing MySQL database server by signal" "mysqld"
killall -15 mysqld
server_down for i in 1 2 3 4 5 6 7 8 9 10; do
sleep 1
if mysqld_status check_dead nowarn; then server_down=1; break; fi
done
if test -z "$server_down"; then killall -9 mysqld; fi
fi
fi

if ! mysqld_status check_dead warn; then
log_end_msg 1
log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.1/README.Debian.gz!"
exit -1
else
log_end_msg 0
fi
;;

'restart')
set +e; $SELF stop; set -e
$SELF start
;;

'reload'|'force-reload')
log_daemon_msg "Reloading MySQL database server" "mysqld"
$MYADMIN reload
log_end_msg 0
;;

'status')
if mysqld_status check_alive nowarn; then
log_action_msg "$($MYADMIN version)"
else
log_action_msg "MySQL is stopped."
exit 3
fi
;;

*)
echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
exit 1
;;
esac





To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#5 Norbert Tretkowski
January 14th, 2011 - 12:10 pm ET | Report spam
Am Freitag, den 14.01.2011, 16:44 +0100 schrieb :
Dear Norbert

> Could you please check if /etc/init.d/mysql checks for mysqld_safe in
> line 20 on your system?

No, it tests -x /usr/sbin/mysqld
(but the #13 mentions mysqld_safe)



It definitely tests for /usr/bin/mysqld_safe since 5.1.49-2, I don't
know why you're still having an outdated init script on your system.

http://svn.debian.org/wsvn/pkg-mysq...mysql.init

Norbert




To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search