mysql8.0/mysql.init
cvsdist f16ef3f517 auto-import changelog data from mysql-3.23.26-1.src.rpm
Wed Oct 18 2000 Trond Eivind Glomsrød <teg@redhat.com>
- 3.23.26, which among other fixes now uses mkstemp() instead of tempnam().
- revert changes made yesterday, Jakub fixed the compiler
Tue Oct 17 2000 Trond Eivind Glomsrød <teg@redhat.com>
- use the compat C++ compiler FTTB. Argh.
- add requirement of ncurses4 (see above)
Sun Oct 01 2000 Trond Eivind Glomsrød <teg@redhat.com>
- 3.23.25
- fix shutdown problem (#17956)
Tue Sep 26 2000 Trond Eivind Glomsrød <teg@redhat.com>
- Don't try to include no-longer-existing PUBLIC file as doc (#17532)
2024-02-05 16:59:11 +01:00

95 lines
1.8 KiB
Bash

#!/bin/sh
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 85 15
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source subsystem configuration.
[ -f /etc/sysconfig/subsys/mysqld ] && . /etc/sysconfig/subsys/mysqld
start(){
touch /var/log/mysqld.log
chown mysql.mysql /var/log/mysqld.log
if [ ! -d /var/lib/mysql/mysql ] ; then
action "Initializing MySQL database" /usr/bin/mysql_install_db
ret=$?
chown -R mysql.mysql /var/lib/mysql
if [ $ret -ne 0 ] ; then
return $ret
fi
fi
/usr/bin/safe_mysqld --user=mysql --log=/var/log/mysqld.log \
--pid-file=/var/run/mysqld.pid >/dev/null 2>&1 &
ret=$?
if [ $ret -eq 0 ]; then
action "Starting MySQL: " /bin/true
else
action "Starting MySQL: " /bin/false
fi
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
return $ret
}
stop(){
echo -n "Shutting down MySQL server"
killproc safe_mysqld
killproc mysqld
ret=$?
[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
[ $ret -eq 0 ] && rm -f /var/lib/mysql/mysql.sock
mysqladmin shutdown > /dev/null 2>& 1
echo
return $ret
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/mysqld ] && restart || :
}
reload(){
[ -e /var/lock/subsys/mysqld ] && mysqladmin reload
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status mysqld
;;
reload)
reload
;;
restart)
restart
;;
condrestart)
condrestart
;;
*)
echo "Usage: $0 {start|stop|status|reload|condrestart|restart}"
exit 1
esac
exit $?