opt/mysql/mysqld
Juergen Daubert 0bbce585ca [notify] mysql: minor structural changes
- location of pid-file changed from /var/run to directory
  /var/run/mysql which is owned by mysql:mysql
- added new directoy /var/log/mysql owned by mysql:mysql which
  can be used to log queries
- logging of queries is now longer enabled in /etc/my.cnf
- error messages are logged to /var/log/mysqld.log

Note:
rejmerge /etc/my.conf to avoid problems due to the above changes
2015-06-29 15:35:17 +02:00

38 lines
703 B
Bash

#!/bin/sh
#
# /etc/rc.d/mysqld: start/stop mysqld daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/mysqld
MYSQL_CFG=/etc/my.cnf
PID=/var/run/mysql/mysqld.pid
LOG=/var/log/mysqld.log
case $1 in
start)
$SSD --start -bC --pidfile $PID --exec $PROG >> $LOG 2>&1
;;
stop)
$SSD --stop --remove-pidfile --retry 10 --pidfile $PID
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --pidfile $PID
case $? in
0) echo "$PROG is running with pid $(cat $PID)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac
# End of file