summaryrefslogtreecommitdiff
path: root/community/percona-server
diff options
context:
space:
mode:
authorMichał Masłowski <mtjm@mtjm.eu>2013-03-09 10:00:51 +0100
committerMichał Masłowski <mtjm@mtjm.eu>2013-03-09 10:00:51 +0100
commit0d2db49bfa6eaddb1409e9cdaf4e688341e75382 (patch)
treebecabe4db4fbf3eeea0bcca6a522f31361562500 /community/percona-server
parentc3917cf06ed660cf3a147f54c9511493dc454012 (diff)
parent92eac63df242654434dceb000bac083f6e81a6b9 (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts: extra/pavucontrol/PKGBUILD
Diffstat (limited to 'community/percona-server')
-rw-r--r--community/percona-server/PKGBUILD21
-rw-r--r--community/percona-server/mysqld-post.sh4
-rw-r--r--community/percona-server/mysqld.rc77
-rw-r--r--community/percona-server/mysqld.service9
-rw-r--r--community/percona-server/percona.install17
5 files changed, 25 insertions, 103 deletions
diff --git a/community/percona-server/PKGBUILD b/community/percona-server/PKGBUILD
index f4738e599..f9dcea252 100644
--- a/community/percona-server/PKGBUILD
+++ b/community/percona-server/PKGBUILD
@@ -1,13 +1,13 @@
-# $Id: PKGBUILD 85072 2013-02-27 09:22:49Z mtorromeo $
+# $Id: PKGBUILD 85883 2013-03-08 08:57:02Z mtorromeo $
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
pkgname=percona-server
-pkgver=5.5.29_rel30.0
+pkgver=5.5.30_rel30.1
pkgrel=1
pkgdesc="A backwards-compatible drop-in replacement for MySQL that provides improved performance, diagnostics and instrumentation"
arch=('i686' 'x86_64' 'mips64el')
-depends=('mysql-clients' 'libaio')
+depends=('mysql-clients' 'libaio' 'systemd-tools')
conflicts=('mysql')
provides=('mysql')
optdepends=('perl-dbi' 'perl-dbd-mysql')
@@ -19,8 +19,6 @@ options=('!libtool' 'emptydirs')
backup=('etc/mysql/my.cnf')
install=percona.install
source=("http://www.percona.com/downloads/Percona-Server-${pkgver%.*_*}/Percona-Server-${pkgver/_rel/-}/source/Percona-Server-${pkgver/_/-}.tar.gz"
- 'mysqld.rc'
- 'my.cnf'
'mysqld-post.sh'
'mysqld.service'
'mysqld-tmpfile.conf')
@@ -79,8 +77,7 @@ package() {
cd "${srcdir}"/build
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 -Dm644 "${pkgdir}"/usr/share/mysql/my-medium.cnf "${pkgdir}"/etc/mysql/my.cnf
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 -Dm644 "${srcdir}"/mysqld.service "${pkgdir}"/usr/lib/systemd/system/mysqld.service
@@ -98,13 +95,9 @@ package() {
# not needed
rm -r ${pkgdir}/usr/{data,mysql-test,sql-bench}
rm "${pkgdir}"/usr/share/man/man1/mysql-test-run.pl.1
-
- install -dm700 "${pkgdir}"/var/lib/mysql
}
-sha256sums=('9cbcb2ad2b66a352a154f2b89c779d79cceea4f6f5ff9ef62f8ae1512c0550a7'
- 'e875fac56f69634b4f1720aec3b952fc63903414e9345af630e5fd74b5373eb4'
- 'dd5dc155de468d4ab26971109861ae19b53574f28785bac5ff7b717fb65c0760'
- '4894d39605950d86841ad982e619daa6c8d5d60ca30928d7dbb582e8cb3ade32'
- 'ca10dec3cc162baede651980e675fd8094e55cb2403edffaa3d0865a6184553f'
+sha256sums=('7309cf2645a1b45a17d6dbfda8c96b00e1186f3b9aba7f8692da14b52f98fb3b'
+ '82a241d9fa4032187a26597d044e94ba810b209b53a7ce14bb6eb92555993a48'
+ '9bc66470f3f80534c0bb62f9f8325ccf60b164f421f74ad74a963f065d7b1869'
'badf6a701d9dc6ea3b4ddca26cb0f42b6236432ccdbc14c64962147802594a60')
diff --git a/community/percona-server/mysqld-post.sh b/community/percona-server/mysqld-post.sh
index 8c404f4c4..516aeb85e 100644
--- a/community/percona-server/mysqld-post.sh
+++ b/community/percona-server/mysqld-post.sh
@@ -1,6 +1,8 @@
#!/bin/sh
+
while true; do
- response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break
+ response=$(/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1) && break
echo "$response" | grep -q "mysqld is alive" && break
+ echo "$response" | grep -q "Access denied for user" && break
sleep 1
done
diff --git a/community/percona-server/mysqld.rc b/community/percona-server/mysqld.rc
deleted file mode 100644
index 07f6b7e4c..000000000
--- a/community/percona-server/mysqld.rc
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/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 Percona Server"
- [ ! -d /var/run/mysqld ] && install -d -g mysql -o mysql /var/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) > /var/run/mysqld/mysqld.pid
- add_daemon mysqld
- stat_done
- fi
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping Percona 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 /var/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
diff --git a/community/percona-server/mysqld.service b/community/percona-server/mysqld.service
index 15802b226..3d2af276c 100644
--- a/community/percona-server/mysqld.service
+++ b/community/percona-server/mysqld.service
@@ -6,15 +6,10 @@ After=syslog.target network.target
User=mysql
Group=mysql
-ExecStart=/usr/bin/mysqld --pid-file=/var/run/mysqld/mysqld.pid
-ExecStop=/bin/kill -15 $MAINPID
-PIDFile=/var/run/mysqld/mysqld.pid
-WorkingDirectory=/usr
+ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid
+ExecStartPost=/usr/bin/mysqld-post
-# We rely on systemd, not mysqld_safe, to restart mysqld if it dies
Restart=always
-
-# Place temp files in a secure directory, not /tmp
PrivateTmp=true
[Install]
diff --git a/community/percona-server/percona.install b/community/percona-server/percona.install
index 55f7cacee..c3b337ae1 100644
--- a/community/percona-server/percona.install
+++ b/community/percona-server/percona.install
@@ -1,15 +1,24 @@
+if [[ $(command -v my_print_defaults >/dev/null 2>&1) ]]; then
+ datadir=$(my_print_defaults mysqld | sed -n "s/^--datadir=//p")
+fi
+[[ -z $datadir ]] && datadir=/var/lib/mysql
+
post_install(){
groupadd -g 89 mysql &>/dev/null
- useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null
- usr/bin/mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
- chown -R mysql:mysql var/lib/mysql &>/dev/null
+ useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
+
+ if [[ ! -e $datadir ]]; then
+ install -dm700 $datadir
+ usr/bin/mysql_install_db --user=mysql --basedir=/usr --datadir=$datadir
+ chown -R mysql:mysql $datadir &>/dev/null
+ fi
usr/bin/systemd-tmpfiles --create mysqld.conf
}
post_upgrade(){
getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null
- getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null
+ getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
if [ "$(vercmp $2 5.5)" -lt 0 ]; then
echo " >> "