Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
reassign 609537 mysql-server-5.5 thanks As far as I can tell this bug doesn't exist in the init.d script shipped with mysql-server-5.6 - I can see waiting code there similar to the code proposed in the patches in this bug. So presumably this should be tracked just in mysql-server-5.5 (which will be removed shortly anyway). If there are still issues with the init.d script shipped in mysql-server-5.6, please correct me. I'll be happy to commit patches that someone can verify fixes the issue. signature.asc Description: Digital signature
Processed: Re: Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
Processing commands for cont...@bugs.debian.org: reassign 609537 mysql-server-5.5 Bug #609537 [mysql-server] /etc/init.d/mysql stop leaves a process but exits with 0 status Bug reassigned from package 'mysql-server' to 'mysql-server-5.5'. No longer marked as found in versions mysql-5.5/5.5.38-0+wheezy1. Ignoring request to alter fixed versions of bug #609537 to the same values previously set thanks Stopping processing here. Please contact me if you need assistance. -- 609537: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609537 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
found 609537 5.5.38-0+wheezy1 thanks I have found this bug happening even on wheezy, on a server that doesn't exit immediately after a mysladmin shutdown. I find that the expectation of the shutdown procedure of Debian's initscript is a little unreasonable: it issues a shutdown command, and if it succeeds, doesn't wait at all before checking if the server is actually down, then fails if the server hasn't shutdown immediately. It seems to me it should simply wait a little while. In a production server we run (internal issue #14187), I have found that waiting even one second completely fixes this problems and allows me again to sleep through the morning log rotation (!). Please consider applying this patch to the stable release: diff --git a/init.d/mysql b/init.d/mysql index 983a8c2..1efd332 100755 --- a/init.d/mysql +++ b/init.d/mysql @@ -150,13 +150,18 @@ case ${1:-''} in 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.5/README.Debian.gz! - exit -1 - else - log_end_msg 0 -fi +# give it a little time to stop at least +for i in 1 2 3 4 5 6 7 8 9 10; do + if mysqld_status check_dead warn; then + log_end_msg 0 +exit 0 + fi + log_progress_msg . + sleep 1 +done + log_end_msg 1 + log_failure_msg MySQL failed to stop even though mysqladmin shutdown succeeded, please stop MySQL manually + exit -1 ;; 'restart') Also note that telling people to RTFM is pretty much useless in this situation, as (1) the warning doesn't actually show up on the terminal and (2) the README doesn't actually address this situation (ie. my debian.cnf file works). I would be happy to NMU this patch into sid and shepherd it into the next wheezy update. Thanks for your feedback, A PS: is it possible this bug was simply forgotten after the squeeze release? i see there was no update since 2012 to the bug yet there are now two patches waiting for review. can we get some action here? -- Faith means not wanting to know what is true. - Friedrich Nietzshe pgpQVosPSRkwZ.pgp Description: PGP signature
Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
Hi, Also as an opposite, the initscript could return 1 even if the daemon has started successfully. I see this on one of my server with innodb_buffer_pool_size = 33G and memlock as the process take some time (more that the 14s allowed in the init to start). Should an other bug be opened for that one? Cheers Laurent Bigonville -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
user release.debian@packages.debian.org usertag 609537 squeeze-can-defer tag 609537 squeeze-ignore kthxbye On Mon, Jan 10, 2011 at 14:09:58 +0100, Marko Randjelovic wrote: Package: mysql-server-5.1 Version: 5.1.49-3 Severity: serious Tags: squeeze From Debian Policy Manual: http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init The init.d scripts must ensure that they will behave sensibly (i.e., returning success and not starting multiple copies of a service) if invoked with start when the service is already running, or with stop when it isn't, and that they don't kill unfortunately-named user processes. The best way to achieve this is usually to use start-stop-daemon with the --oknodo option. It is possible to get into state when there is mysqld_safe process remained, though main mysqld process is stopped and pid file deleted. In such cases, /etc/init.d/mysql procedure mysqld_status check_dead warn will return true and script will do nothing, returning with success. But as cited from policy manual, it should fail, since there are remaining mysqld processes. One way to get into this situation is to start, then stop server from mysqld-admin, which I intend to report as a separate bug on mysqld-admin. I'm not sure this part of policy applies when the service was started by a completely separate means which removes pid files without killing processes (I haven't checked what mysqld-admin does). So I don't know if there's a bug here, but in any case it's not a release blocker, tagging accordingly. Cheers, Julien signature.asc Description: Digital signature
Processed: Re: Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
Processing commands for cont...@bugs.debian.org: user release.debian@packages.debian.org Setting user to release.debian@packages.debian.org (was jcris...@debian.org). usertag 609537 squeeze-can-defer Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status There were no usertags set. Usertags are now: squeeze-can-defer. tag 609537 squeeze-ignore Bug #609537 [mysql-server-5.1] /etc/init.d/mysql stop leaves a process but exits with 0 status Added tag(s) squeeze-ignore. kthxbye Stopping processing here. Please contact me if you need assistance. -- 609537: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609537 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#609537: /etc/init.d/mysql stop leaves a process but exits with 0 status
Package: mysql-server-5.1 Version: 5.1.49-3 Severity: serious Tags: squeeze From Debian Policy Manual: http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init The init.d scripts must ensure that they will behave sensibly (i.e., returning success and not starting multiple copies of a service) if invoked with start when the service is already running, or with stop when it isn't, and that they don't kill unfortunately-named user processes. The best way to achieve this is usually to use start-stop-daemon with the --oknodo option. It is possible to get into state when there is mysqld_safe process remained, though main mysqld process is stopped and pid file deleted. In such cases, /etc/init.d/mysql procedure mysqld_status check_dead warn will return true and script will do nothing, returning with success. But as cited from policy manual, it should fail, since there are remaining mysqld processes. One way to get into this situation is to start, then stop server from mysqld-admin, which I intend to report as a separate bug on mysqld-admin. Best regards -- System Information: Debian Release: 6.0 APT prefers testing APT policy: (745, 'testing'), (740, 'maverick'), (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core) 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 [debconf-2.0 1.5.36 Debian configuration management sy ii libc62.11.2-7Embedded 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 libmysqlclient16 5.1.49-3MySQL database client library ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3 ii lsb-base 3.2-23.1Linux Standard Base 3.2 init scrip ii mysql-client-5.1 5.1.49-3MySQL database client binaries ii mysql-common 5.1.49-3MySQL database common files, e.g. ii mysql-server-core-5. 5.1.49-3MySQL database server binaries ii passwd 1:4.1.4.2+svn3283-2 change and administer password and ii perl 5.10.1-16 Larry Wall's Practical Extraction ii psmisc 22.11-1 utilities that use the proc file s ii zlib1g 1:1.2.3.4.dfsg-3compression 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 Versions of packages mysql-server-5.1 suggests: pn tinycanone (no description available) -- Configuration Files: /etc/init.d/mysql changed [not included] -- debconf information: mysql-server/error_setting_password: mysql-server-5.1/nis_warning: mysql-server-5.1/really_downgrade: false mysql-server-5.1/start_on_boot: true mysql-server-5.1/postrm_remove_databases: false mysql-server/password_mismatch: mysql-server/no_upgrade_when_using_ndb: --- mysql.orig 2010-11-30 18:55:00.0 +0100 +++ mysql 2011-01-10 13:56:56.792943257 +0100 @@ -149,8 +149,10 @@ case ${1:-''} in if test -z $server_down; then killall -9 mysqld; fi fi fi - -if ! mysqld_status check_dead warn; then + failure= + mysqld_status check_dead warn || failure=true + ps -A -o args | grep -E (^/bin/sh /usr/bin/mysqld_safe($| )|^/usr/sbin/mysqld($| )) /dev/null failure=true +if [ $failure ]; 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