[Bug 359177] Re: Strange or obsolete code in mysql initscript

born2chill david.gabriel at oeamtc.at
Thu Sep 24 13:07:46 BST 2009


I also have problems with this initscript (mostly with wrong return
codes in scripted shutdowns), however i think that the author overlooked
an 'else' statement:

@142ff: instead of:
142           if [ "$r" -ne 0 ]; then
143             log_end_msg 1
144             [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
145             log_daemon_msg "Killing MySQL database server by signal" "mysqld"
146             killall -15 mysqld
147             server_down=
148             for i in 1 2 3 4 5 6 7 8 9 10; do
149               sleep 1
150               if mysqld_status check_dead nowarn; then server_down=1; break; fi
151             done

imho it probably shoud be:
142           if [ "$r" -ne 0 ]; then
143             log_end_msg 1
144             [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
145             log_daemon_msg "Killing MySQL database server by signal" "mysqld"
146             killall -15 `pgrep mysqld_safe\ --server-id=${INSTANCENMB}`
147           else
148             server_down=
149             for i in `seq 1 10`; do
150               sleep 1
151               if mysqld_status check_dead nowarn; then server_down=1; break; fi
152             done

in this case the server is only killed if the 'mysqladmin shutdown'
before the statement fails, otherwise the script goes into the 10
seconds for-loop checking if mysql has gone away for sure, otherwise
killing it with -9. It is still true that the 'VERBOSE'-test is
obsolete...

br,
David

-- 
Strange or obsolete code in mysql initscript
https://bugs.launchpad.net/bugs/359177
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-dfsg-5.0 in ubuntu.



More information about the Ubuntu-server-bugs mailing list