exit 1
fi
-case "$mode" in
+case "$1" in
+ start)
# Check if the service is already running?
if [ ! -f /var/lock/subsys/mysql ]; then
show Starting mysql
busy
- su mysql -c '/usr/bin/msqld
+ su mysql -c '/usr/sbin/mysqld > /dev/null &'
touch /var/lock/subsys/mysql
deltext
ok
;;
stop)
show Stopping mysql service
- killproc postmaster
+ killproc mysqld
sleep 2
rm -f /var/state/mysql/mysqld.pid
rm -f /var/lock/subsys/mysql
;;
status)
- status postmaster
+ status mysqld
;;
restart|reload)
$0 stop
*)
echo "Usage: mysql {start|stop|status|restart|reload}"
exit 1
- 'start')
-
- if test -x $bindir/safe_mysqld
- then
- # Give extra arguments to mysqld with the my.cnf file. This script may
- # be overwritten at next upgrade.
- $bindir/safe_mysqld --user=$mysql_daemon_user --pid-file=$pid_file --datadir=$datadir &
- else
- echo "Can't execute $bindir/safe_mysqld"
- fi
- ;;
-
- 'stop')
- # Stop daemon. We use a signal here to avoid having to know the
- # root password.
- if test -f "$pid_file"
- then
- mysqld_pid=`cat $pid_file`
- echo "Killing mysqld with pid $mysqld_pid"
- kill $mysqld_pid
- # mysqld should remove the pid_file when it exits.
- else
- echo "No mysqld pid file found. Looked for $pid_file."
- fi
- ;;
-
- *)
- # usage
- echo "usage: $0 start|stop"
- exit 1
- ;;
+ ;;
esac
+