Sudo in php script not stopping mysql database
Posted by:
tdldp tdldp ()
Date: November 17, 2008 04:34AM
Hi everyone...
I've set up a php / shell (sh) script to deploy a database construction, and it must end in a mysql stop, and then a mysql start.
For security reasons, it is not executed under root privileges, and i setup sudoers with user : toto and cmd_alias on /etc/init.d/mysql stop / start commands locally, with no password.
Up to there everything works (i mean commands get executed), except on mysql start, which throws an error...
Debugging things, i got to following problem...
User toto, even if it has rights in sudo, doesn't seem to stop mysql.
Indeed, i get message mysql is stopping, but after comming back to command line and doing an ps aux | grep mysql, i still have :
root 29981 0.0 0.0 8488 1448 pts/0 S 11:08 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 30021 0.0 0.5 149688 24036 pts/0 Sl 11:08 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/home/mysql/data --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 32215 0.0 0.0 4412 692 pts/0 S+ 11:33 0:00 grep mysql
How can i cleanly stop all mysql services, and assure everything is all stopped correctly ??? I've searched all WE, without finding a solution and am getting a bit exasparated... Any help is welcome...
Tdldp
Sorry, you can't reply to this topic. It has been closed.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.