On Tue, Jun 15, 2004 at 08:04:00AM -0500, Steve Buehler wrote: > I am having a problem with a backup script that is written in a shell > (/bin/sh) script to backup my mysql databases. For some reason on any day > with an even number I get the following error: > MySQL could not be stopped, exiting... > It is really weird because it will run on odd number days without a > problem. Should I put some kind of a wait in the script after it stops the > mysqld and before it checks to make sure the pid file is still there? If > so, does anybody know how? I am not sure that that will solve the problem > though because it exits afterward and the mysql daemon is still running > without having to restart it. Below is the relevant part of the script. > The script is run from cron with this line > 0 1 * * * /root/backup/backup.sh >/dev/null 2>&1 > But since the logs do show it running, That shouldn't be the problem. > Thanks > Steve > > ######### Perform myisamchk > #mysqladmin -p$MYSQLPWD shutdown > /etc/rc.d/init.d/mysqld stop > if [ -f $mysqlpid ]; then
Does /etc/rc.d/init.d/mysqld (however indirectly) remove the $mysqlpid file when it exits? Is $mysqlpid the same as '/etc/rc.d/init.d/mysqld start' would create? Couldn't you check for an exit status of '/etc/rc.d/init.d/mysqld stop' instead? I've played stupid games like this, to work around weak management scripts (pseudo-code): while( -f $mysqlpid ) sleep 1 end There are risks with that, as well, of course, but you see what it's trying to do... -- Brian Reichert <[EMAIL PROTECTED]> 37 Crystal Ave. #303 Daytime number: (603) 434-6842 Derry NH 03038-1713 USA BSD admin/developer at large -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]