Commit dafd4fd0 authored by Michael's avatar Michael

mysql: readded mysqld.rc, typo in mysqld.service

parent 57637430
......@@ -6,7 +6,7 @@
pkgbase=mysql
pkgname=('libmysqlclient' 'mysql-clients' 'mysql')
pkgver=5.5.27
pkgrel=1
pkgrel=2
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.mysql.com/"
......@@ -16,12 +16,14 @@ source=("http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.5/${pkgbase}-${pkgv
'my.cnf'
'mysqld.service'
'mysqld-tmpfile.conf'
'mysqld-post.sh')
'mysqld-post.sh'
'mysqld.rc')
sha256sums=('51ffafbd82039f8afbe5b3c26f15cc338ed6cd4f67e56d7dd33efaa28c9d99e4'
'400e9a6e6517bbfe0971b65456dfacfb363cb54a644e4c2bacd373171611d5aa'
'1288b512b08cf0458437357c6ca378db66c78884868afab5ddea4ad61059c168'
'2af318c52ae0fe5428e8a9245d1b0fc3bc5ce153842d1563329ceb1edfa83ddd'
'9e98b2f942b407032f3a98914dc1d9a6a4bfe09d10b652bc040b0c213fc7a91b')
'10399597f40de9ee8bf9a9aa3f185096e49b62d6207994f0bf90d3c50fdfdfcc'
'badf6a701d9dc6ea3b4ddca26cb0f42b6236432ccdbc14c64962147802594a60'
'9e98b2f942b407032f3a98914dc1d9a6a4bfe09d10b652bc040b0c213fc7a91b'
'0399f1104074cbe8721d808a360f55ee55489063d37f7a5e5a8bdb5fd3be63bc')
build() {
cd "${srcdir}"
......@@ -112,10 +114,10 @@ package_mysql(){
make DESTDIR="${pkgdir}" install
install -Dm644 "${srcdir}"/my.cnf "${pkgdir}"/etc/mysql/my.cnf
install -Dm755 "${srcdir}"/mysqld.rc "${pkgdir}"/etc/rc.d/mysqld
install -Dm755 "${srcdir}"/mysqld-post.sh "${pkgdir}"/usr/bin/mysqld-post
install -Dm644 "${srcdir}"/mysqld-tmpfile.conf "${pkgdir}"/usr/lib/tmpfiles.d/mysqld.conf
install -d "${pkgdir}"/usr/lib/systemd/system
install -Dm644 "${srcdir}"/mysqld.service "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 "${srcdir}"/mysqld.service "${pkgdir}"/usr/lib/systemd/system/mysqld.service
# provided by libmysqlclient
rm "${pkgdir}"/usr/bin/{mysql_config,mysql_client_test_embedded,mysqltest_embedded}
......
d /run/mysqld 0755 mysql mysql -
d /run/mysqld 0755 mysql mysql -
\ No newline at end of file
#!/bin/bash
# general config
. /etc/rc.conf
. /etc/rc.d/functions
getPID() {
echo $(pgrep -u mysql mysqld 2>/dev/null);
}
case "$1" in
start)
stat_busy "Starting MySQL Server"
[ ! -d /run/mysqld ] && install -d -g mysql -o mysql /run/mysqld &>/dev/null
if [ -z "$(getPID)" ]; then
/usr/bin/mysqld_safe --user=mysql &>/dev/null &
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
timeo=30
while [ $timeo -gt 0 ]; do
response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break
echo "$response" | grep -q "mysqld is alive" && break
sleep 1
let timeo=${timeo}-1
done
if [ $timeo -eq 0 ]; then
stat_fail
exit 1
else
echo $(getPID) > /run/mysqld/mysqld.pid
add_daemon mysqld
stat_done
fi
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping MySQL Server"
if [ ! -z "$(getPID)" ]; then
timeo=30
kill $(getPID) &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
fi
while [ ! -z "$(getPID)" -a $timeo -gt 0 ]; do
sleep 1
let timeo=${timeo}-1
done
if [ -z "$(getPID)" ]; then
rm -f /run/mysqld/mysqld.pid &>/dev/null
rm_daemon mysqld
stat_done
else
stat_fail
exit 1
fi
else
stat_fail
exit 1
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
mysqld.service
===========
[Unit]
Description=MySQL Server
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment