2013/6/6 Mike Franon <kongfra...@gmail.com> > I am running mysql 5.0 for now, and I have a script that I wrote at 12 am, > that stops mysql server, unmounts the disk that has mysql, and takes a > different snapshot from amazon as the new disk. > > > Long story short, 50% of the time the command /etc/init.d/mysqld stop will > fail > > > Stopping MySQL: [FAILED] > > Unmounting /opt on dbserver1 > > > I then log on the server and mysql is still running. > > When that happens what is the best way to stop mysql? I am trying to write > something in my script that will do that, and thinking of using the kill > command, but is that the best way?
> > Or should I be using mysqladmin stop? Is there a better way to bring down > mysql server and make sure it is down? Should I be doing something else to > ensure it comes down? > Hello, The first thing I would do is to check why that 50% of the time the MySQL doesn't get stopped. That's the issue you should start looking at. Once that problem has been found...you can use either /etc/init.d/mysql stop or mysqladmin. Both should work in the same way. You should never use kill. In order to check it, you can just try to use pgrep to look for the process and/or also check whether the .pid (and/or .sock) exists. I would always use a combination of two methods to make sure it is stopped. Hope this helps. Manuel. -- Manuel Aróstegui Systems Team tuenti.com