[debian-mysql] Bug#663060: mysql-server-5.1: '/etc/init.d/mysql start' exits with status code 1 on success if debian-start prints nothing

David Gubler dg at doodle.com
Thu Mar 8 09:15:29 UTC 2012

Package: mysql-server-5.1
Version: 5.1.61-0+squeeze1
Severity: normal

On our servers, I have added "exit 0" at the top of /etc/mysql/debian-start (we've had trouble with checks running accidentially on our large myisam tables, and apparently that file is ment to be modified if necessary).

The result is that this file does not generate any output to stdout.

Now, /etc/init.d/mysql does the following on start (line 119-121):

# Now start mysqlcheck or whatever the admin wants.
[ -n "$output" ] && log_action_msg "$output"

Since this is the last (!) statement executed, it has a nasty side effect: The exit code of the test statement becomes the exit code of the whole script! Thus, if /etc/mysql/debian-start does not generate any output, /etc/init.d/mysql start exits with code 1. This is not a problem in normal operation (rebooting the server etc.), but it causes apt to fail whenever it needs to restart mysql due to an upgrade or similar.

I think the fix is trivial: Just add "exit 0" after line 121.


Best regards,

David Gubler

-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 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-5.1 depends on:
ii  adduser     3.112+nmu2                   add and remove users and groups
ii  debconf [de                     Debian configuration management sy
ii  libc6       2.11.3-2                     Embedded GNU C Library: Shared lib
ii  libdbi-perl 1.612-1                      Perl Database Interface (DBI)
ii  libgcc1     1:4.4.5-8                    GCC support library
ii  libmysqlcli 5.1.61-0+squeeze1            MySQL database client library
ii  libstdc++6  4.4.5-8                      The GNU Standard C++ Library v3
ii  lsb-base    3.2-23.2squeeze1             Linux Standard Base 3.2 init scrip
ii  mysql-clien 5.1.61-0+squeeze1            MySQL database client binaries
ii  mysql-commo 5.1.61-0+squeeze1            MySQL database common files, e.g. 
ii  mysql-serve 5.1.61-0+squeeze1            MySQL database server binaries
ii  passwd      1: change and administer password and
ii  perl        5.10.1-17squeeze3            Larry Wall's Practical Extraction 
ii  psmisc      22.11-1                      utilities that use the proc file s
ii  zlib1g      1:             compression library - runtime

Versions of packages mysql-server-5.1 recommends:
ii  bsd-mailx [mailx]  8.1.2-0.20100314cvs-1 simple mail user agent
ii  libhtml-template-p 2.9-2                 module for using HTML Templates wi
ii  mailx              1:20071201-3          Transitional package for mailx ren

Versions of packages mysql-server-5.1 suggests:
pn  tinyca                        <none>     (no description available)

-- Configuration Files:
/etc/mysql/debian-start changed:
echo "debian-start: not doing anything"
exit 0
source /usr/share/mysql/debian-start.inc.sh
MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"
echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
) >&2 &
exit 0

-- debconf information excluded

More information about the pkg-mysql-maint mailing list