5736950da1
Wed Mar 28 2001 Trond Eivind Glomsrød <teg@redhat.com> - Make it obsolete our 6.2 PowerTools packages - 3.23.36 bugfix release - fixes some security issues which didn't apply to our standard configuration - Make "make test" part of the build process, except on IA64 (it fails there) Tue Mar 20 2001 Trond Eivind Glomsrød <teg@redhat.com> - 3.23.35 bugfix release - Don't delete the mysql user on uninstall Tue Mar 13 2001 Trond Eivind Glomsrød <teg@redhat.com> - 3.23.34a bugfix release Wed Feb 07 2001 Trond Eivind Glomsrød <teg@redhat.com> - added readline-devel to BuildRequires: Tue Feb 06 2001 Trond Eivind Glomsrød <teg@redhat.com> - small i18n-fixes to initscript (action needs $) Tue Jan 30 2001 Trond Eivind Glomsrød <teg@redhat.com> - make it shut down and rotate logs without using mysqladmin (from #24909) Mon Jan 29 2001 Trond Eivind Glomsrød <teg@redhat.com> - conflict with "MySQL" Tue Jan 23 2001 Trond Eivind Glomsrød <teg@redhat.com> - improve gettextizing Mon Jan 22 2001 Trond Eivind Glomsrød <teg@redhat.com> - 3.23.32 - fix logrotate script (#24589)
101 lines
1.9 KiB
Bash
101 lines
1.9 KiB
Bash
#!/bin/bash
|
|
#
|
|
# mysqld This shell script takes care of starting and stopping
|
|
# the MySQL subsystem (mysqld).
|
|
#
|
|
# chkconfig: - 78 12
|
|
# description: MySQL database server.
|
|
# processname: mysqld
|
|
# config: /etc/my.cnf
|
|
# pidfile: /var/run/mysqld/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
|
|
|
|
|
|
prog="MySQL"
|
|
|
|
start(){
|
|
touch /var/log/mysqld.log
|
|
chown mysql.mysql /var/log/mysqld.log
|
|
chmod 0640 /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
|
|
chown mysql.mysql /var/lib/mysql
|
|
chmod 0755 /var/lib/mysql
|
|
/usr/bin/safe_mysqld --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
|
|
ret=$?
|
|
if [ $ret -eq 0 ]; then
|
|
action $"Starting $prog: " /bin/true
|
|
else
|
|
action $"Starting $prog: " /bin/false
|
|
fi
|
|
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
|
|
return $ret
|
|
}
|
|
|
|
stop(){
|
|
/bin/kill `cat /var/run/mysqld/mysqld.pid 2> /dev/null ` > /dev/null 2>&1
|
|
ret=$?
|
|
if [ $ret -eq 0 ]; then
|
|
action $"Stopping $prog: " /bin/true
|
|
else
|
|
action $"Stopping $prog: " /bin/false
|
|
fi
|
|
[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
|
|
[ $ret -eq 0 ] && rm -f /var/lib/mysql/mysql.sock
|
|
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 $?
|